Page 1 of 1

ADODB DSN STRING

Posted: Thu May 22, 2003 9:41 am
by largeinnit
Hi,

What I'm trying to do is simple enough - use php with an access database without using a odbc connection. The code below works fine if I omit the userid and password from the dsn string and then remove the password from the database.

However as soon as I password the database i get problems. I haven't set any userids on the access database, so I'm not too sure what to pass as the user name in the dsn string (or even how to add a username to the access database). I've tried leaving the user name out, tried admin, owner, "", etc but none seem to work.

At best I get the message
" Cannot start your application. The workgroup information file is missing or opened exclusively by another user."

Although the database isn't being used by any other users.


$cnx=NewADOConnection('ado_access');
$access="c:\php\wordsortedall.mdb";

$myDsn= 'PROVIDER=Microsoft.Jet.OLEDB.4.0;'
. 'DATA SOURCE=' .$access .';user name=dan;password=mypwd;' ;

$cnx->PConnect($myDsn) or die("Can't conn " . $cnx->ErrorMsg());


Any help much appreciated.