RE: [PHP-DB] - Delete records in an Access DB

2004-05-03 Thread Uzi Klein

[EMAIL PROTECTED] wrote :
 
 Fatal error: Call to undefined function: open() in
 D:\Inetpub\webs\metagenonlinecom\canc.php on line 11



I assume the error is match case in open function...
Should be $db-Open...  etc.


-Original Message-
From: Michael Forbes [mailto:[EMAIL PROTECTED] 
Sent: Monday, May 03, 2004 07:00
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] - Delete records in an Access DB

Nope.

Access' version of SQL is a slight bit different from ANSI SQL.  All he 
needs to do in his statement is change it to this:

$query=DELETE * FROM Test_Table WHERE name='franco';;

(notice the wildcard in there-- Access isn't smart enough to realize 
that the deletion of any information in a row automatically means 
deleting the entire row.  I guess the original design must've intended 
to use delete for an update columnname = null.)

-Mike Forbes

Uzi Klein wrote:

 Match Case ?
 
 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
 Sent: Sunday, May 02, 2004 09:19
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] - Delete records in an Access DB
 
 
 
 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  

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] - Delete records in an Access DB

2004-05-03 Thread Michael Forbes
Heh, yeah, I didn't read far enough-- and boy do I feel like a troll 
now.  My apologies, case inconsistencies probably are causing his 
problem-- but he'll also have a problem with the SQL statement when it 
gets that far, if he doesn't tell it what to delete (i.e., wildcard), 
simply b/c that's the way Access behaves.

-Mike Forbes

Uzi Klein wrote:

[EMAIL PROTECTED] wrote :

Fatal error: Call to undefined function: open() in
D:\Inetpub\webs\metagenonlinecom\canc.php on line 11


I assume the error is match case in open function...
Should be $db-Open...  etc.
-Original Message-
From: Michael Forbes [mailto:[EMAIL PROTECTED] 
Sent: Monday, May 03, 2004 07:00
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] - Delete records in an Access DB

Nope.

Access' version of SQL is a slight bit different from ANSI SQL.  All he 
needs to do in his statement is change it to this:

$query=DELETE * FROM Test_Table WHERE name='franco';;

(notice the wildcard in there-- Access isn't smart enough to realize 
that the deletion of any information in a row automatically means 
deleting the entire row.  I guess the original design must've intended 
to use delete for an update columnname = null.)

-Mike Forbes

Uzi Klein wrote:


Match Case ?

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Sunday, May 02, 2004 09:19
To: [EMAIL PROTECTED]
Subject: [PHP-DB] - Delete records in an Access DB



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  


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] - Delete records in an Access DB

2004-05-02 Thread francesco


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