Re: - Delete records in an Access DB
| From: | Torsten Roehr | Date: | Sat, 01 May 2004 22:39:39 +0000 |
| Subject: | Re: - Delete records in an Access DB | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-185113@lists.php.net to get a copy of this message | ||
So the problem is not the delete statement but that you cannot even open a
connection, right? Have you tried PHP's ODBC functions to connect to the
Access DB?:
http://de.php.net/manual/en/function.odbc-connect.php
There are some user comments regarding Access - maybe this helps.
Regards, Torsten
<francesco@automationsoft.biz> wrote in message
news:001b01c42fcb$bb445260$fa9f1c97@portatile...
Hi all,
I have this problem:
I want to delete records in an Access DB. I use this code:
$query="DELETE FROM Test_Table WHERE name='franco';";
// the connection parameters
$path="d:/inetpub/webs/my_site/mdb-database/" ;
$db_name="test.mdb" ;
$dsource=$path.$db_name ;
$cn_string="Provider=Microsoft.Jet.OLEDB.4.0;" ;
$cn_string.="Data Source=$dsource;" ;
// connection
$cn=new COM("ADODB.Connection");
$cn->open($cn_string);
// object Recordset and send query by Open() metod
$rs=new COM("ADODB.Recordset") ;
$rs->open($query,$cn) ;
// clean Recordset object
$rs->Release() ;
$rs=null ;
/* close connection */
$cn->Close() ;
$cn->Release() ;
$cn=null ;
but I have this error message:
Fatal error: Call to undefined function: open() in
D:\Inetpub\webs\metagenonlinecom\canc.php on line 11
Where is the problem? Is this the correct way to delete records from an
Access DB? If this is a bad tecnic, can you suggest me what is the correct
way?
Thanks in advance to all.
(The server where this script run is a Microsoft server).
Francesco