<%
'------------------------------------------------------------------------------------------------
'主机名称
Select Case Request.ServerVariables("LOCAL_ADDR")
Case "127.0.0.1"
SQL_SERVERNAME = "127.0.0.1"
Case "192.168.0.3"
SQL_SERVERNAME = "192.168.0.3"
Case "192.168.0.35"
SQL_SERVERNAME = "192.168.0.35"
Case Else
SQL_SERVERNAME = "LBE001\LIFETOBESQL"
End Select
'------------------------------------------------------------------------------------------------
'------------------------------------------------------------------------------------------------
'资料库连结设定
SQL_DB_ID = SYSTEM_ID
SQL_DB_NAME = "db_" & SQL_DB_ID
SQL_DB_PW = MD5("LifeToBe_" & SQL_DB_ID)
SQL_DB_CONN = "Provider=SQLOLEDB.1;" &_
"Password=" & SQL_DB_PW & ";" &_
"Persist Security Info=True;" &_
"User ID=" & SQL_DB_ID & ";" &_
"Initial Catalog=" & SQL_DB_NAME & ";" &_
"Data Source=" & SQL_SERVERNAME
Set CONN = Server.CreateObject("ADODB.Connection")
CONN.Open SQL_DB_CONN
'------------------------------------------------------------------------------------------------
%>
然后呢会提示这样的错误,首先说一下我的数据库服务器名称是TEST-SERVER, 里面有想个库DB_SYSOP和DB_TEST
技术信息(用于支持人员)
错误类型:
Microsoft OLE DB Provider for SQL Server (0x80004005)
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server 不存在或拒绝访问。
/test2/conn.asp, 第 30 行
浏览器类型:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)
网页:
POST 53 ??? /test2/index.asp
POST Data:
User_ID=color&User_PW=color&submit1.x=52&submit1.y=11
时间:
2007年7月21日, 13:49:05