展开全部
<%
Dim SqlDatabaseName,SqlPassword,SqlUsername,SqlLocalName,ConnStr,Conn
SqlDatabaseName = "xxx" 'SQL数据库名
SqlUsername = "xxx" 'SQL数据库用户名
SqlPassword = "xxx" 'SQL数据库用户密码
SqlLocalName = "127.0.0.1" 'SQL主机IP地址(本地可用“127.0.0.1”或“(local)”,非本机请用真实IP)
ConnStr = "Provider = Sqloledb; User ID = " & SqlUsername & "; Password = " & SqlPassword & "; Initial Catalog = " & SqlDatabaseName & "; Data Source = " & SqlLocalName & ";"
Set conn = Server.CreateObject("ADODB.Connection")
conn.open ConnStr
%>
Dim SqlDatabaseName,SqlPassword,SqlUsername,SqlLocalName,ConnStr,Conn
SqlDatabaseName = "xxx" 'SQL数据库名
SqlUsername = "xxx" 'SQL数据库用户名
SqlPassword = "xxx" 'SQL数据库用户密码
SqlLocalName = "127.0.0.1" 'SQL主机IP地址(本地可用“127.0.0.1”或“(local)”,非本机请用真实IP)
ConnStr = "Provider = Sqloledb; User ID = " & SqlUsername & "; Password = " & SqlPassword & "; Initial Catalog = " & SqlDatabaseName & "; Data Source = " & SqlLocalName & ";"
Set conn = Server.CreateObject("ADODB.Connection")
conn.open ConnStr
%>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询