sql数据库链接如何链接?下面的连接代码是否正确?谢谢大侠门?
<%
'================================================================================================================
SqlDatabaseName="abbccdd"
SqlPassword="***********"
SqlUsername="sa"
SqlLocalName="(local)"
'-----------------------------------------------------------------------------------------------------
connstr="driver={SQL Server};server="&SqlLocalName&";uid="&SqlUsername&";pwd="&SqlPassword&";database="&SqlDatabaseName&";"
On Error Resume Next
Set conn = Server.CreateObject("ADODB.Connection")
conn.commandtimeout=20
conn.open ConnStr
If Err Then
err.Clear
Set Conn = Nothing
Response.Write "<br><br><br><br><br><br><br><div align='center'>数据库连接出错!请检查连接数据库的参数及字符串设置是否正确!</div>
参考答案:正确