展开全部
你是想看看是否连接成功的话比容易,以ASP为例
Dim Conn
Dim ConnStr
ConnStr="Provider=SQLOLEDB;Persist Security Info=True;User ID=sa;Pwd=000000;Initial Catalog=ACCP_ASP;Data Source=127.0.0.1"
Set Conn= Server.CreateObject("ADODB.Connection")
Conn.ConnectionString="Provider=SQLOLEDB;Persist Security Info=True;User ID=sa;Pwd=000000;Initial Catalog=ACCP_ASP;Data Source=127.0.0.1"
Conn.Open
If Err Then
err.Clear
Set Conn = Nothing
Response.Write("<meta http-equiv=""Content-Type"" content=""text/html; charset=utf-8"" />
Response.End
End If
就是OPEN一下看是否有错误
Dim Conn
Dim ConnStr
ConnStr="Provider=SQLOLEDB;Persist Security Info=True;User ID=sa;Pwd=000000;Initial Catalog=ACCP_ASP;Data Source=127.0.0.1"
Set Conn= Server.CreateObject("ADODB.Connection")
Conn.ConnectionString="Provider=SQLOLEDB;Persist Security Info=True;User ID=sa;Pwd=000000;Initial Catalog=ACCP_ASP;Data Source=127.0.0.1"
Conn.Open
If Err Then
err.Clear
Set Conn = Nothing
Response.Write("<meta http-equiv=""Content-Type"" content=""text/html; charset=utf-8"" />
Response.End
End If
就是OPEN一下看是否有错误
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询