Access (yeah, Access) data types
Posted: Sat Mar 22, 2003 12:17 pm
I'm writing a script for a site that is hosted on a Windows NT platform. Although they have the good taste to run PHP, they do not follow through with MySQL and only offer Access DB. That's OK I suppose - I only need a lightweight DB and Access is ODBC compliant.
Anyway, I'm having some trouble with Access as I've never used it before. I'm trying to create a table through a SQL query and am running into some difficulties in creating a field with the "AUTONUMBER" Access datatype.
$query="CREATE TABLE users (id AUTONUMBER,name TEXT,hash TEXT)";
when executed gives me
Warning: SQL error: [Microsoft][ODBC Microsoft Access Driver] Syntax error in field definition., SQL state 37000 in SQLExecDirect
I can make any other datatype - TEXT, MEMO, NUMBER, YES/NO - but the AUTONUMBER throws an error. Ideally I'd like to make the ID the primary key, but at this point I'll settle for just getting an auto_increment!
Please don't tell me to RTFM...I don't have the docs, and I'm not about to buy a book on Access for one lousy script.
Thanks in advance!
Tony
Anyway, I'm having some trouble with Access as I've never used it before. I'm trying to create a table through a SQL query and am running into some difficulties in creating a field with the "AUTONUMBER" Access datatype.
$query="CREATE TABLE users (id AUTONUMBER,name TEXT,hash TEXT)";
when executed gives me
Warning: SQL error: [Microsoft][ODBC Microsoft Access Driver] Syntax error in field definition., SQL state 37000 in SQLExecDirect
I can make any other datatype - TEXT, MEMO, NUMBER, YES/NO - but the AUTONUMBER throws an error. Ideally I'd like to make the ID the primary key, but at this point I'll settle for just getting an auto_increment!
Please don't tell me to RTFM...I don't have the docs, and I'm not about to buy a book on Access for one lousy script.
Thanks in advance!
Tony