Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CREATE TABLE and set DEFAULTVALUE of a Field

Status
Not open for further replies.

dougcranston

Technical User
Oct 5, 2001
326
US
I have checked the jetsql40.chm, and the web, and Tek-Tips for a reference on whether or not DEFAULT is available in Access 2000. It does not appear as a reserved word in Jet SQL either.

I spotted some code that indicated that it would, but my attempts generate an error "MICROSOFT ACCESS - Syntax error in CREATE TABLE STATEMENT"

My guess is that the snippets I spotted although stated for Access were really for another database.

Code sample is as follows:

CREATE TABLE TestAllTypes
( MyText TEXT(50) NOT NULL,
MyMemo MEMO,
MyByte BYTE,
MyInteger INTEGER NOT NULL DEFAULT 0,
MyLong LONG,
MyAutoNumber COUNTER NOT NULL PRIMARY KEY,
MySingle SINGLE,
MyDouble DOUBLE,
MyCurrency CURRENCY,
MyReplicaID GUID,
MyDateTime DATETIME,
MyYesNo YESNO NOT NULL,
MyOleObject LONGBINARY,
MyBinary BINARY(50)
)

Would appreciate any input on this..

Thanks inadvance.

DougCranston
 
may be you need to say:

MyInteger INTEGER NOT NULL DEFAULTVALUE 0,

-DNG
 
I tried the DEFAULTVALUE but it generates the same error.

Defaultvalue is the field name in Access.. DEFAULT was the phrase I saw in the snippet.

Thanks for the thought.

DougCranston
 
JetSQL is far away from ANSI compliance, I must say ...
 
PHV,

More I learn the less I know.. Especially when it comes to Access and Jet SQL..

Have a great weekend.

DougCranston
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top