28,391
社区成员
发帖
与我相关
我的任务
分享
<%
dim conn,connstr,startime
'On Error Resume Next
Set conn = Server.CreateObject("ADODB.Connection")
connstr="Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;pwd=123123;Initial Catalog=FINWeb;Data Source="+server.mappath("/data/FINWeb_Data.MDF")
conn.Open connstr
If Err Then
err.Clear
Set conn = Nothing
Response.Write "The database conjunction comes amiss, pleasing the check the conjunction the character string."
Response.End
End If
%>
<%
dim conn,connstr,startime
'On Error Resume Next
Set conn = Server.CreateObject("ADODB.Connection")
SqlDatabaseName = "Web" 'SQL数据库名
SqlUsername = "sa" 'SQL数据库用户名
SqlPassword = "123456" 'SQL数据库用户密码
SqlLocalName = "xp\SQL2005" 'SQL主机IP地址(服务器名)
ConnStr = " Password = "&SqlPassword&"; user id =" & SqlUsername&"; Initial Catalog ="&SqlDatabaseName&"; data source ="& SqlLocalName &";Provider = sqloledb;"
Set conn = Server.CreateObject("ADODB.Connection")
conn.open ConnStr
If Err Then
err.Clear
Set conn = Nothing
Response.Write "The database conjunction comes amiss, pleasing the check the conjunction the character string."
Response.End
End If
%>