Article View: borland.public.cppbuilder.database.ado
Article #1482Re: Auto Increment Question
From: Kim Utley
Date: Thu, 01 Jul 2004 15:24
Date: Thu, 01 Jul 2004 15:24
54 lines
2668 bytes
2668 bytes
Sorry it is MS Jet.
When I create a table the statement is:
CREATE TABLE Test( AutoIncrement COUNTER( 1, 1 ) [, other field names and
types]
CONSTRAINT PrimaryKeyIndex PRIMARY KEY( AutoIncrement [, other field
names and types] )
This works for all other tables that don't have the autoincrement
type.However, when I add/use the autoincrement field I get the exception
"Syntax error in field definition". Any idea what's causing this and what
does the ( 1, 1 ) in the COUNTER mean?
Kindest Regards,
Kim
"Viatcheslav V. Vassiliev" <support@oledbdirect.com> wrote in message
news:40e3b857$1@newsgroups.borland.com...
> What it your DBMS? In MS SQL Server do:
> CREATE TABLE Test (Col1 INT IDENTITY(1, 1) PRIMARY KEY)
>
> The same syntax works for MS Jet (MS Access), as well as:
> CREATE TABLE Test (Col1 COUNTER(1, 1) PRIMARY KEY)
>
> //------------------------------------------
> Regards,
> Vassiliev V. V.
> http://www.managed-vcl.com - using .Net objects in Delphi for Win32 +
> ADO.Net
> http://www.oledbdirect.com - The fastest way to access MS SQL Server,
> MS Jet (Access) and Interbase (through OLEDB)
>
> "Kim Utley" <kim@simsware.com> �������/�������� � �������� ���������:
> news:40e31878$1@newsgroups.borland.com...
> > I have the need to use an autoincrement field in a database so the
primary
> > key will be unique. However I don't know the SQL syntax for it. I've
tried
> > "AUTO_INCREMENT", "AUTOINC" and "AUTO_INC" when creating the table
fields
> > but get a failure "Syntax error in field definition". Does anyone have a
> > brief example of doing this or the syntax?
> >
> > Kindest Regards,
> >
> >
> > Kim Utley
> >
> >
>
>
Technical Details
Message-ID:
<40e42ca9@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!hammer.uoregon.edu!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<40e31878$1@newsgroups.borland.com> <40e3b857$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,7e1df2a336eac17 X-Google-Attributes: gid10698b,public X-Google-Language: ENGLISH,ASCII From: "Kim Utley" <kim@simsware.com> Newsgroups: borland.public.cppbuilder.database.ado References: <40e31878$1@newsgroups.borland.com> <40e3b857$1@newsgroups.borland.com> Subject: Re: Auto Increment Question Date: Thu, 1 Jul 2004 10:24:23 -0500 Lines: 56 Organization: SIMS, Inc. X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 NNTP-Posting-Host: 65.205.74.2 Message-ID: <40e42ca9@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1088695465 65.205.74.2 (1 Jul 2004 08:24:25 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!hammer.uoregon.edu!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail