1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2013
    Rep Power

    Unhappy Access database connection?

    I have a script that has worked perfectly with my former hosting company but not work with my new hosting provider.

    The section that I think might be causing the problem is below. The original script is
    'database path
    strDBPath = "/dbase/database.mdb"

    Set objConn = Server.CreateObject("ADODB.Connection")
    objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0; " & _
    "Data Source = " & Server.MapPath(strDBPath) & ";" & _
    "User Id=Admin;" & _

    The new hosting provider has this in their knowledge base:

    How to connect to a MS Access database from an ASP Script

    Please use the following sample code to connect to a MS Access .mdb file:

    Dim ConnectionString
    ConnectionString = "DRIVER={Microsoft Access Driver (*.mdb)};" &_

    Dim Connection
    Set Connection = Server.CreateObject("ADODB.Connection")

    Connection.ConnectionTimeout = 30
    Connection.CommandTimeout = 80
    Connection.Open ConnectionString

    Can anyone adapt the original code with this other code info?
    I am not good with access databases connection issues
  2. #2
  3. No Profile Picture
    Grumpier old Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2003
    Rep Power
    The hosting company is illustrating a connection using the older ODBC access drivers, which I don't recommend using. Your original connection looks ok, if it doesn't work it's probably some issue with the location of the .mdb file on the new host not matching your script
    Doug G
    I've never been able to appreciate the sublime arrogance of folks who feel they were put on earth just to save other folks from themselves .." - Donald Hamilton

IMN logo majestic logo threadwatch logo seochat tools logo