mahongquan said:
in my application,i use sql to communicate with access database,i don't
know
how to set default value in create table syntax.who can help me? thanks a
lot.
Hi mahongquan,
"In my application..." can mean so many different things, but ...
In addition to Marshall's learned DAO advice,
here be some examples using CurrentProject.Connection.Execute ...
CurrentProject.Connection.Execute "CREATE TABLE z1 (myText TEXT(50) DEFAULT
""my Default value"" ) ", dbFailOnError
Currentproject.Connection.Execute "CREATE TABLE TEMP (Field1 single DEFAULT
0, Field2 long)", dbFailOnError
CurrentProject.Connection.Execute "CREATE TABLE TableName (FieldName LONG
DEFAULT 333);", dbFailOnError
Currentproject.Connection.Execute "CREATE TABLE test (DateField DATE DEFAULT
Date())", dbFailOnError
Currentproject.Connection.Execute "ALTER TABLE Temp ALTER COLUMN Field2 SET
DEFAULT 5", dbFailOnError
Apologies for jumping in.
good luck,
gary