高分请教conn.asp连接设置

来源:百度知道 编辑:UC知道 时间:2024/07/07 09:46:12
我是初学者希望高手能教我一下。如何设置连接才能使用,答案要详细具体,我试过后,能行的才选为最佳答案,请不要随便从网上粘贴一些答案来敷衍我
以下是wap网站最原始的conn文件如下
<%
'option explicit
Response.Buffer = True
Rem 忽略所有错误
'On Error Resume Next
dim startime
dim Conn
dim ConnStr
startime=timer()
%>
<!--#INCLUDE file="Config.asp" -->
<%
Rem 缓存名称
SiteSN = Replace(Replace(LCase(Request.ServerVariables("SERVER_NAME")), "/", ""), ".", "")
Admin=Request("Admin")
Sub ConnectionDatabase
If IsSqlDataBase = 1 Then
Rem 如果是SQL数据库,请认真修改好以下数据库选项
DataServer = "(local)" '数据库服务器IP
DataUser = "WapLink" '访问数据库用户名
DataBaseName = "WapLink" '数据库名称
DataBasePsw = "518116" '访问数据库

<!--#include file="config.asp"-->
<!--#include file="ver.asp"-->
<!--#include file="Inc/Inc_Functions.asp"-->
<!--#include file="API/Api_Config.asp"-->
<%
'-----------------------------------------
'conn.asp
'数据库参数设置
'-----------------------------------------

'数据库类型:0-Access,1-Sql Server
Const Is_Sqldata = 0

'使用外部数据库:0-不使用,1-使用
Const Is_ot_User = 0

'数据库连接参数变量定义
Dim G_Sql_DelChar,G_Sql_Now,G_Sql_d_Char
Dim G_Sql_y,G_Sql_m,G_Sql_d,G_Sql_h,G_Sql_mi,G_Sql_s
Dim connstr,conn,db

'外部数据库参数变量定义
Dim ot_connstr,ot_conn,ot_usertable,ot_username,ot_password
Dim ot_regurl,ot_lostpasswordurl,ot_modIfypass1,ot_modIfypass2

'检验系统状态
Call SystemState

'连接数据库
Sub link_database()
If Is_Sqldata = 0 Then
'Access数据库连接参数
'此处必须为以