/ Published in: ASP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
'**************************************** ' VBScript MS Access database connection '**************************************** dim strConn, objConn, sql, rst if lcase(Request.ServerVariables("SERVER_NAME")) = "localhost" then strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\inetpub\wwwroot\mysite\db.mdb;" else strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.MapPath("/") & "\db.mdb;" end if set objConn = server.createobject("adodb.connection") objConn.open strConn