ODBC data types
| From: | Stephen Brooks | Date: | Sun, 17 Sep 2006 21:50:03 +0000 |
| Subject: | ODBC data types | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-42361@lists.php.net to get a copy of this message | ||
I am accessing a Microsoft Access 2000 database using the Unified ODBC functions. My problem is that some SQL field types are not recognised and cause the database driver to a (generic) syntax error. For instance
odbc_exec($odbc,'CREATE TABLE FormData (formid LONG,dataphp LONG VARCHAR)');
...does not work because of "LONG VARCHAR". I've tried various things and find that VARCHAR works, but is restricted to 256 characters (TEXT is accepted but appears to have the same restriction). VARBINARY seems OK on that statement but the field is truncated to 1 character (might be my mistake here). And BLOB, LONG VARCHAR, LONG VARBINARY and variants thereof are all not accepted.
Oddly, "LONG" is accepted even though in SQL it should be "BIGINT" or similar (which is not accepted).
I want a field that will work and allows 64k or more characters in a string (ideally binary).
-Stephen