Defining Default Value for a Field

S

Saulo Eduardo

Hi buddies,

I'm having troubles to create a table, by a SQL statement, wich one of yours
columns have a default valeu. The statement that I'm executing is something
like this:

create table Table01 ([Field01] long Default 0)

If I remove the "Default 0" part from the SQL statement it works properly
but Field01 is created without a Default Value (In this case, the default
value is 0). Otherwise, it's raise an error.
Has anyone sugestions?

Thanks since now!
 
A

Allen Browne

From memory, the Default syntax is only partially implemented in Access.

It does not work in the interface (which uses DAO), but you might get it to
work with:
strSql = "create table Table01 ([Field01] long Default 0)"
CurrentProject.Connection.Execute strSql
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top