Bug #40695 [Opn->Nab]: odbc_execute/prepared statements does not work with Access

From: Date: Fri, 25 Sep 2020 17:11:49 +0000
Subject: Bug #40695 [Opn->Nab]: odbc_execute/prepared statements does not work with Access
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-229218@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=40695&edit=1

 ID:                 40695
 Updated by:         cmb@php.net
 Reported by:        a at bc dot de
 Summary:            odbc_execute/prepared statements does not work with
                     Access
-Status:             Open
+Status:             Not a bug
 Type:               Bug
 Package:            ODBC related
 Operating System:   Windows
 PHP Version:        5.2.1
-Assigned To:        
+Assigned To:        cmb
 Block user comment: N
 Private report:     N

 New Comment:

With current PHP versions and the Microsoft Access Driver (*.mdb,
*.accdb) 14.00.7010.1000 the supplied test script fails with:

SQL error: [Microsoft][ODBC Driver Manager] The driver does not support this function, SQL state
IM001 in SQLDescribeParameter

SQLDescribeParam() is a level 2 interface, and drivers are not
required to implement such functions.  However, the ODBC extension
needs to call this function, so there is nothing we can do about
that.

@ilyalyu at yahoo dot com, prepared statements should work fine
nowadays with the SQL Server ODBC drivers.


Previous Comments:
------------------------------------------------------------------------
[2009-05-11 18:49:16] ilyalyu at yahoo dot com

This bug makes odbc unusable if you need to insert large data into the table. There are only two
alternatives:
1. Use odbc_exec, which fails with large data because of stack limit.
2. Use odbc_prepare and odbc_execute, which fails because of the bug described above.
So, both alternatives fail.

OS Windowx XP, PHP Version 5.2.6, Database - Windows SQL Server 2008.

------------------------------------------------------------------------
[2008-09-05 03:11:04] geoff dot brisbine at gmail dot com

Forgot in last post, this is accessing Paradox 4.x tables.

------------------------------------------------------------------------
[2008-09-05 02:48:31] geoff dot brisbine at gmail dot com

It's happening for me on Windows XP Pro SP2 w/Apache 2.2 and PHP 5.2.6 (php5apache2_2.dll).

------------------------------------------------------------------------
[2007-03-02 18:34:29] a at bc dot de

Description:
------------
[repost of bug 6275]

Hello,

My problem is odbc_execute fails with the following error message:

Warning: SQL error: [Microsoft][ODBC Microsoft Access Driver]COUNT field
incorrect , SQL state 07001 in SQLExecute in
d:\Inetpub\wwwroot\php\adodb\index.php on line 77

The odbc_exec INSERT works fine. I am using a plain vanilla NorthWind MS
Access database and am using the ISAPI version of PHP, with ODBC built
in.



Reproduce code:
---------------
$conn = odbc_connect("nwind","","");
odbc_exec($conn,"drop table ADOXYZ"); 
odbc_exec($conn,"create table ADOXYZ (id int, firstname char(24),
lastname char(24))"); 	
odbc_exec($conn,"insert into ADOXYZ (id,firstname,lastname) values
(0,'Zend','PHP')");
$stmt = odbc_prepare($conn,"insert into ADOXYZ (id,firstname,lastname)
values (?,?,?)");
if ($stmt) {
	print "Trying execute<br>";
	$stmt = odbc_execute($stmt,array(1,"John","Lim"));
}

Actual result:
--------------
Warning: SQL error: [Microsoft][ODBC Microsoft Access Driver]COUNT field
incorrect , SQL state 07001 in SQLExecute in
d:\Inetpub\wwwroot\php\adodb\index.php on line 77


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=40695&edit=1


Thread (7 messages)

« previous php.bugs (#229218) next »