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

    Join Date
    Jan 2013
    Posts
    1
    Rep Power
    0

    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
    [code]
    '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;" & _
    "Password="


    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)};" &_
    "DBQ=C:\path\to\file.mdb;DefaultDir=;UID=;PWD=;"

    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
    Posts
    14,428
    Rep Power
    4539
    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
    ======
    Bartender to Rene Descartes "have another beer?" Descartes: "I think not" and he vanished.
    --Alfred Bester

IMN logo majestic logo threadwatch logo seochat tools logo