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 / Modules / DAO / VBA / September 2006

Tip: Looking for answers? Try searching our database.

AutoNumber data type

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Del - 27 Sep 2006 21:26 GMT
The following code works with all data types except AutoNumber.  I get a
"Syntax error in field definition" error message.  Can anyone help me make
AutoNumber work?

DoCmd.RunSQL "CREATE TABLE tblTest(XYZ Datetime);"
Signature

Thank you,
Del

Douglas J. Steele - 27 Sep 2006 22:42 GMT
I believe you use Identity rather than Autonumber.

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)

> The following code works with all data types except AutoNumber.  I get a
> "Syntax error in field definition" error message.  Can anyone help me make
> AutoNumber work?
>
> DoCmd.RunSQL "CREATE TABLE tblTest(XYZ Datetime);"
Del - 27 Sep 2006 23:02 GMT
I get the same error message with:

DoCmd.RunSQL "CREATE TABLE tblTest(XYZ Identity);"
Signature

Thank you,
Del

> I believe you use Identity rather than Autonumber.
>
[quoted text clipped - 3 lines]
> >
> > DoCmd.RunSQL "CREATE TABLE tblTest(XYZ Datetime);"
Douglas J. Steele - 28 Sep 2006 02:07 GMT
Sorry, that's what I get for not looking it up.

DoCmd.RunSQL "CREATE TABLE tblTest(XYZ Counter)"

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)

>I get the same error message with:
>
[quoted text clipped - 9 lines]
>> >
>> > DoCmd.RunSQL "CREATE TABLE tblTest(XYZ Datetime);"
Del - 28 Sep 2006 15:51 GMT
Thanks, that works.
Signature

Thank you,
Del

> Sorry, that's what I get for not looking it up.
>
[quoted text clipped - 13 lines]
> >> >
> >> > DoCmd.RunSQL "CREATE TABLE tblTest(XYZ Datetime);"
RoyVidar - 28 Sep 2006 18:59 GMT
"Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in
message <#78SMqp4GHA.3600@TK2MSFTNGP03.phx.gbl>:
> Sorry, that's what I get for not looking it up.
>
[quoted text clipped - 16 lines]
>>> http://I.Am/DougSteele
>>> (no private e-mails, please)

The identity syntax works, but on an ADO connection, for instance

CurrentProject.Connection.Execute _
   "CREATE TABLE tblTest(XYZ Int Identity);"

Signature

Roy-Vidar

 
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.