php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40695 odbc_execute/prepared statements does not work with Access
Submitted: 2007-03-02 18:34 UTC Modified: 2008-09-01 10:02 UTC
Votes:20
Avg. Score:4.5 ± 0.6
Reproduced:20 of 20 (100.0%)
Same Version:8 (40.0%)
Same OS:16 (80.0%)
From: a at bc dot de Assigned:
Status: Open Package: ODBC related
PHP Version: 5.2.1 OS: Windows
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: a at bc dot de
New email:
PHP Version: OS:

 

 [2007-03-02 18:34 UTC] 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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-09-05 02:48 UTC] 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).
 [2008-09-05 03:11 UTC] geoff dot brisbine at gmail dot com
Forgot in last post, this is accessing Paradox 4.x tables.
 [2009-05-11 18:49 UTC] 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.
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Wed Aug 21 04:01:26 2019 UTC