|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37877 255 char limit for SQL statements
Submitted: 2006-06-21 17:48 UTC Modified: 2006-07-30 01:00 UTC
Avg. Score:4.3 ± 0.9
Reproduced:0 of 0 (0.0%)
From: jr at johnrule dot com Assigned:
Status: No Feedback Package: *Database Functions
PHP Version: 4.4.2 OS: xp
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2006-06-21 17:48 UTC] jr at johnrule dot com
An 'INSERT' command with more than 255 characters will fail when using COM and an ADODB.Connection (i.e. a direct connection to an access.mdb file). However, the command will succeed if you connect through an ODBC connection to the same file. This would prove that the limitation is not a part of the file itself, but a part of the functionality of the interface...wouldn't it?

I tested this on PHP 4 and 5 with the same results:

Apache 2
PHP (4 or 5)
Windows XP

Reproduce code:
Just try to do an 'INSERT' command with more than 255 characters in it. It works on an Access.mdb file through a System DSN (ODBC) but it fails when using COM and ADODB.Connection (i.e. a direct connection to the file).


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-06-22 19:04 UTC]
Duplicate of bug #37757.
 [2006-06-22 19:35 UTC] jr at johnrule dot com

This is not about 'retrieving' data, or limits for data fields, this is about a limit in executing SQL statements directly through a COM(ADODB.Connection) to an Access .mdb file.


INSERT INTO users (first_name, last_name, address, city, state, zip, username, password) VALUES ('Jonathan', 'Macintyre the 3rd', '123456789 Somewhere in the United States', 'Idaho', 'ID', '12345-12345', 'jonathanmacintyrethe3rd','thisismypassword')

The above command will fail because it is greater than 255 chars. 

The command below will succeed however, using the exact same type of connection:

INSERT INTO users (fname, lname, address, city, state, zip) VALUES ('Jon', 'Mac', '123 US St.', 'Idaho', 'ID', '12345','jmac','1234')

Do you see what I mean? This is the same limitation imposed if you try to create a module in Access with a 'RunSQL' command as the parameter...the field is limited to 255 chars.

However, the first command greater than 255 chars will succeed if you connect through an ODBC (DSN) connection. I am not sure whose limitation this is at this point? Since php is making the connection and call to both, I was guessing that this is a php problem.
 [2006-07-22 12:20 UTC]
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try to avoid embedding huge scripts into the report.

 [2006-07-30 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Wed Sep 28 11:05:55 2022 UTC