Results 1 to 4 of 4
  1. #1

    Default PHP Connection string

    I'm trying to connect to an Access database using PHP...long story. The ADODB connection string I'm using works fine on my laptop with IIS but online I get the following error:

    Fatal error: Uncaught exception 'com_exception' with message '<b>Source:</b> Microsoft OLE DB Provider for ODBC Drivers<br/><b>Description:</b> [Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x80c Thread 0x58f4 DBC 0x10a30ffc Jet'.' in D:\inetpub\vhosts\tellymania.com\httpdocs\test0.ph p:6 Stack trace: #0 D:\inetpub\vhosts\tellymania.com\httpdocs\test0.ph p(6): com->Open('DRIVER={Microso...') #1 {main} thrown in * snip path to file *on line 6

    The code:

    line 5: $conn = new COM('ADODB.Connection') or exit('Cannot start ADO.');
    line 6: $conn->Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=". ("D:\inetpub\vhosts\tellymania.com\private\db2.mdb ").";");


    Is this a permissions error? I'm sure I got the path to the database right. What connection string would work?

  2. #2
    Join Date
    Oct 2006
    Location
    localhost
    Posts
    3,375

    Smile

    Quote Originally Posted by Phatman View Post
    I'm trying to connect to an Access database using PHP...long story. The ADODB connection string I'm using works fine on my laptop with IIS but online I get the following error:

    Fatal error: Uncaught exception 'com_exception' with message '<b>Source:</b> Microsoft OLE DB Provider for ODBC Drivers<br/><b>Description:</b> [Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x80c Thread 0x58f4 DBC 0x10a30ffc Jet'.' in D:\inetpub\vhosts\tellymania.com\httpdocs\test0.ph p:6 Stack trace: #0 D:\inetpub\vhosts\tellymania.com\httpdocs\test0.ph p(6): com->Open('DRIVER={Microso...') #1 {main} thrown in * snip path to file *on line 6

    The code:

    line 5: $conn = new COM('ADODB.Connection') or exit('Cannot start ADO.');
    line 6: $conn->Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=". ("D:\inetpub\vhosts\tellymania.com\private\db2.mdb ").";");


    Is this a permissions error? I'm sure I got the path to the database right. What connection string would work?
    This does sound like a permissions problem, I've corrected it on your domain, also you can give a try rather with using a DSN.

    You can have a look at the following for more info on Access connection string:

    ## Access Connection String Samples - ConnectionStrings.com
    ## PHP Database ODBC

    ## Microsoft Access Database Connectivity « PHP recipes « ActiveState Code

    Rock _a.k.a._ Jack
    Windows Hosting || Windows Reseller Hosting
    Cloud Hosting 100% UPTIME! || Powerful Dedicated Servers
    Follow eUKhost on Twitter || Join eUKhost Community on Facebook

    For complaints, grievances or suggestions kindly email our FeedBack Dept.
    Proper action will be taken accordingly & instantaneously!

  3. #3

    Default

    Ok, sorted it. I decided to go for OLEDB for performance but I had to escape the back slashes in the path to the database with double back slashes

  4. #4
    Join Date
    Oct 2006
    Location
    localhost
    Posts
    3,375

    Thumbs up

    Quote Originally Posted by Phatman View Post
    Ok, sorted it. I decided to go for OLEDB for performance but I had to escape the back slashes in the path to the database with double back slashes
    Glad to hear that

    Rock _a.k.a._ Jack
    Windows Hosting || Windows Reseller Hosting
    Cloud Hosting 100% UPTIME! || Powerful Dedicated Servers
    Follow eUKhost on Twitter || Join eUKhost Community on Facebook

    For complaints, grievances or suggestions kindly email our FeedBack Dept.
    Proper action will be taken accordingly & instantaneously!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •