asp数据连接函数与关闭
asp数据连接函数,asp数据连接函数与关闭
Sub ConnectionDatabase()
On Error Resume Next
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open Connstr
If Err Then
Err.Clear
Set Conn = Nothing
Response.Write "数据库连接出错,请打开conn.asp文件检查连接字串。"
Response.End
End If
End Sub
Sub CloseConn()
On Error Resume Next
If IsObject(Conn) Then
Conn.Close
Set Conn = Nothing
End If
Set Newasp = Nothing
End Sub
补充:asp教程,ASP入门