<%
'******************************
'函數:ConnectionMssql(ConnStr)
'參數:ConnStr,數據庫連接代碼
'作者:阿裡西西
'日期:2007/7/13
'描述:通用數據庫連接過程
'示例:<%=ConnectionMssql("Provider = Microsoft.Jet.OLEDB.4.0;Data Source = test.mdb")%>
'******************************
Sub ConnectionMssql(ConnStr)
On Error Resume Next
Set objConn = Server.Createobject("ADODB.Connection")
objConn.ConnectionTimeout = 12
objConn.ConnectionString = Trim(ConnStr)
objConn.Open
If objConn.Errors.Count = 0 Then
Else
Response.Write "ConnectionMssql","數據連接失敗,請檢查配置文件!"
Response.End
End If
End Sub
%>