By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,132 Members | 1,425 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,132 IT Pros & Developers. It's quick & easy.

can't connect to Access

P: n/a
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 =& ADONewConnection('access');
$dsn = "Driver={Microsoft Access Driver
(*.mdb)};Dbq=newres.mdb;Uid=Admin;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\wwwroot\resphp\adodb\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 = &ADONewConnection('access'); # crée une connexion
$conn->PConnect('phpaccess'); # se connecte à MS-Access

When using OLEDB:
<?php
include('../adodb/adodb.inc.php');
$db =& ADONewConnection('access');
$dsn= "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=newres.mdb;User
Id=admin;Password=;";
$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\wwwroot\resphp\adodb\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


Sep 26 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.