can't connect to Access

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • chris

    #1

    can't connect to Access

    Hi,

    I try to connect to Access with php with te code below. The database and
    table are ok.
    <?php
    include('../adodb/adodb.inc.php') ;
    $db =& ADONewConnectio n('access');
    $dsn = "Driver={Micros oft Access Driver
    (*.mdb)};Dbq=ne wres.mdb;Uid=Ad min;Pwd=;";
    $db->Connect($dsn );
    .....

    I get the error:
    Warning: odbc_connect() [function.odbc-connect]: SQL error: [Microsoft][ODBC
    Microsoft Access Driver]General error Unable to open registry key 'Temporary
    (volatile) Jet DSN for process 0x840 Thread 0x860 DBC 0xb48c3c Jet'., SQL
    state S1000 in SQLConnect in
    D:\Inetpub\wwwr oot\resphp\adod b\drivers\adodb-odbc.inc.php on line 60
    [Microsoft][ODBC Microsoft Access Driver]General error Unable to open
    registry key 'Temporary (volatile) Jet DSN for process 0x840 Thread 0x860
    DBC 0xb48c3c Jet'.


    When using a DSN connection, it works:
    <?php
    include('../adodb/adodb.inc.php') ;
    $conn = &ADONewConnecti on('access'); # crée une connexion
    $conn->PConnect('phpa ccess'); # se connecte à MS-Access

    When using OLEDB:
    <?php
    include('../adodb/adodb.inc.php') ;
    $db =& ADONewConnectio n('access');
    $dsn= "Provider=Micro soft.Jet.OLEDB. 4.0;Data Source=newres.m db;User
    Id=admin;Passwo rd=;";
    $db->Connect($dsn );

    I get this error:
    Warning: odbc_connect() [function.odbc-connect]: SQL error: [Microsoft][ODBC
    Driver Manager] Data source name not found and no default driver specified,
    SQL state IM002 in SQLConnect in
    D:\Inetpub\wwwr oot\resphp\adod b\drivers\adodb-odbc.inc.php on line 60
    [Microsoft][ODBC Driver Manager] Data source name not found and no default
    driver specified

    Any help would be welcome.
    Kevin




Working...