从动网里给你找出来的连接代码……
Const SqlDatabaseName = "dvbbs"
Const SqlPassword = "dvbbs"
Const SqlUsername = "dvbbs"
Const SqlLocalName = "(local)"
SqlNowString = "GetDate()"
Dim ConnStr
On Error Resume Next
ConnStr = "Provider = Sqloledb; User ID = " & SqlUsername & "; Password = " & SqlPassword & "; Initial Catalog = " & SqlDatabaseName & "; Data Source = " & SqlLocalName & ";"
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.open ConnStr
If Err Then
err.Clear
Set Conn = Nothing
Response.Write "数据库连接出错,请检查连接字串。"'注释,需要把这几个字翻译成英文。
Response.End
End If