MS Access connectivity from ASP Code - How to connect MS Access Database with ASP?

Collapse

Unconfigured Ad Widget

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Shane
    Senior Member
    • Jun 2006
    • 264

    MS Access connectivity from ASP Code - How to connect MS Access Database with ASP?

    In order to connect with MS Access database from ASP one need to use below mentioned code:

    Dim strConn
    Set strConn = Server.CreateObject("ADODB.Connection")
    strConn="DRIVER={Microsoft Access Driver (*.mdb)}; "

    strConn=strConn & "DBQ=" & Server.mappath("db/mydb.mdb")
    -OR-
    strConn=strConn & "DBQ=C:\domains\mydomain.com\db\mydb.db"

    One can use any connection path as they are either absolute or relative. This connection is a DSN Less connection.
    Last edited by admin; 08-21-2015, 04:49 AM.
  • Shane
    Senior Member
    • Jun 2006
    • 264

    #2
    Re: MS Access connectivity from ASP Code - How to connect MS Access Database with ASP

    In order to connect with MS Access database from ASP one can use below mentioned code:

    Dim strConn
    Set strConn = Server.CreateObject("ADODB.Connection")
    strConn.ConnectionString = "DSN=test"
    strConn.Open
    Response.Write "Access Connection Successful"

    This connection is DSN Based connection. For that one need to setup DSN either from the server or control panel.
    Last edited by admin; 08-21-2015, 04:50 AM.

    Comment

    • shikha
      Junior Member
      • Dec 2008
      • 3

      #3
      Re: MS Access connectivity from ASP Code - How to connect MS Access Database with ASP

      Hello

      Thanks for the connectivity code. if i get any problem i really consult with you.

      thanks

      Comment

      Working...
      X