[thelist] Create table SQL and MSAccess syntax

matthew garrett matthew.garrett at snet.net
Sat Apr 21 21:20:39 CDT 2001


> From: "Joshua Olson" <joshua at alphashop.net>

> http://support.microsoft.com/support/kb/articles/Q209/0/37.ASP

Good link, Joshua. I just want to point out that there is also more
information and more examples in the Help section of Access itself. There is
a section on SQL, and Access' particular needs. I'll throw in my example of
what I was working on earlier this week:

<cfquery name="addalpha" datasource="#dsn#">
CREATE TABLE alphasplit
(
    alpha_id COUNTER NOT NULL CONSTRAINT keyer PRIMARY KEY,
    consult BIT NOT NULL,
    startletter CHAR(1) NOT NULL,
    endletter CHAR(1) NOT NULL,
    contact_id INTEGER NOT NULL CONSTRAINT linksto REFERENCES
contacts(contact_id)
);
</cfquery> 

>> From: Jon
>> However, I am receiving a syntax error. I found out
>> that the 'AUTO_INCREMENT' was giving the error. I took
>> it out and it worked fine, but I need the
>> AUTO_INCREMENT. How can I get my sql to set the field
>> as AUTO_INCREMENT?

As seen in all examples, COUNTER works where AUTO_INCREMENT does not.

matt





More information about the thelist mailing list