Posted By

wizard04 on 09/08/09


Tagged

database ASP access vbscript


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

nelda751
benrudolph


VBScript MS Access Database Connection


 / Published in: ASP
 

  1. '****************************************
  2. ' VBScript MS Access database connection
  3. '****************************************
  4.  
  5. dim strConn, objConn, sql, rst
  6.  
  7. if lcase(Request.ServerVariables("SERVER_NAME")) = "localhost" then
  8. strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\inetpub\wwwroot\mysite\db.mdb;"
  9. else
  10. strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.MapPath("/") & "\db.mdb;"
  11. end if
  12.  
  13. set objConn = server.createobject("adodb.connection")
  14. objConn.open strConn

Report this snippet  

You need to login to post a comment.