Forum Moderators: coopster

Message Too Old, No Replies

MS Access PHP

ms access php connection

         

meclive

4:37 pm on Jul 19, 2004 (gmt 0)

10+ Year Member



I have an access database which connects to my website via php and all this is working fine but... when i set a password on my access database it all goes wrong, even though i think i am writing the php correctly. The basic code i am using to connect is as follows;

if (!$conn = new COM("ADODB.Connection"))
exit("Unable to create an ADODB connection<br>");
$strConn = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" . realpath("database.mdb");
$conn->open($strConn);

So where should i put in the PWD= as i have tried this but got nowhere! Any help on this matter would be appreciated, regards meclive.

coopster

6:49 pm on Jul 19, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



The manual pages [php.net] give an example...

$conn = new COM("ADODB.Connection") or die("Cannot start ADO"); 
$conn->Open("Provider=SQLOLEDB; Data Source=localhost;
Initial Catalog=database; User ID=user; Password=password");