asp连接Access数据库的代码,有需要的朋友可以参考下。
<%
Dim Conn
Sub OpenConn()
Dim ConnStr
ConnStr = "Provider = Microsoft.Jet.OLEDB.4.0;Data Source = " & Server.MapPath(db)
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
Sub CloseConn()
conn.close
set conn=nothing
End Sub
%>