Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / August 2006

Tip: Looking for answers? Try searching our database.

Defining Default Value for a Field

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Saulo Eduardo - 14 Aug 2006 19:58 GMT
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!
Allen Browne - 15 Aug 2006 05:10 GMT
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

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

> Hi buddies,
>
[quoted text clipped - 12 lines]
>
> Thanks since now!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.