2个回答
展开全部
<%
Const SqlDatabaseName = "test" ' 数据库名字'
Const SqlPassword = "123" '数据库密码'
Const SqlUsername = "sa" '数据库帐户'
Const SqlLocalName = "127.0.0.1" '数据库地址'
'数据库连接函数'
Sub ConnectionDatabase
Dim ConnStr
ConnStr = "Provider = Sqloledb; User ID = " & SqlUsername & "; Password = " & SqlPassword & "; Initial Catalog = " & SqlDatabaseName & "; Data Source = " & SqlLocalName & ";"
On Error Resume Next
Set conn = Server.CreateObject("ADODB.Connection")
conn.open ConnStr
If Err Then
err.Clear
Set Conn = Nothing
Response.Write "数据库连接出错,请检查连接字串!"
Response.End
End If
End Sub
'默认打开数据库连接
call ConnectionDatabase()
%>
现在学的话,就学ASP.NET啦
程序这东西,入门了就很爽,开始都要坚持
祝你好运。。
Const SqlDatabaseName = "test" ' 数据库名字'
Const SqlPassword = "123" '数据库密码'
Const SqlUsername = "sa" '数据库帐户'
Const SqlLocalName = "127.0.0.1" '数据库地址'
'数据库连接函数'
Sub ConnectionDatabase
Dim ConnStr
ConnStr = "Provider = Sqloledb; User ID = " & SqlUsername & "; Password = " & SqlPassword & "; Initial Catalog = " & SqlDatabaseName & "; Data Source = " & SqlLocalName & ";"
On Error Resume Next
Set conn = Server.CreateObject("ADODB.Connection")
conn.open ConnStr
If Err Then
err.Clear
Set Conn = Nothing
Response.Write "数据库连接出错,请检查连接字串!"
Response.End
End If
End Sub
'默认打开数据库连接
call ConnectionDatabase()
%>
现在学的话,就学ASP.NET啦
程序这东西,入门了就很爽,开始都要坚持
祝你好运。。
展开全部
下面连接,或者你可以搜 十天学会ASP教程 这个教程很简单,也很好用。。。
参考资料: http://www.webjx.com/htmldata/2005-08-24/1124870722.html
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询