Re: ADO Connection Problems

From: Date: Wed, 17 Sep 2003 10:48:14 +0000
Subject: Re: ADO Connection Problems
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-30548@lists.php.net to get a copy of this message
Why are you using COM - haveyou looked at PEAR DB - this is class that makes conencting ot various DB's easy in php http://pear.php.net/manual/en/package.database.php Joe Mack wrote:
I am having problems making things happen in a Microsoft Access Database that I am connecting to through an ADO Connection using PHP. I know a little bit about PHP and how to code, but this is the first time I have played around with the ADO Connection and Command objects. I am getting no error messages or anything, but when I browse the database, my changes are not being posted. Here is an example of what I am trying to do. Hopefully, I am just missing a step along the way. $dbFile = '\\\\SERVER\\FOLDER\\BackEnd.mdb'; $conn = new COM('ADODB.Connection'); $conn->Open("DRIVER=Microsoft Access Driver (*.mdb);DBQ=$dbFile"); $cmd = new COM('ADODB.Command'); $cmd->ActiveConnection = $conn; $cmd->CommandText = "UPDATE TABLE1 SET FIELD1 = '$parm1' WHERE FIELD2 = '$parm2';"; $cmd->Prepared = TRUE; $RSet = $cmd->Execute(); Any assistance anyone can offer would be greatly appreciated. Thank you. Joe


« previous php.db (#30548) next »