Article View: borland.public.cppbuilder.database.ado
Article #1488Re: Auto Increment Question
From: Viatcheslav V. Vassiliev
Date: Thu, 01 Jul 2004 16:31
Date: Thu, 01 Jul 2004 16:31
73 lines
3504 bytes
3504 bytes
1, 1 - initial value and increment. If I am not wrong, AutoIncrement could be used too. Try to enclose column names into brackets - there could be keyword there: CREATE TABLE Test ([AutoIncrement] COUNTER(1, 1) ...) //------------------------------------------ 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:40e42ca9@newsgroups.borland.com... > 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:
<40e43c52@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.frii.net!newsfeed.frii.net!news.compaq.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<40e31878$1@newsgroups.borland.com> <40e3b857$1@newsgroups.borland.com> <40e42ca9@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: "Viatcheslav V. Vassiliev" <support@oledbdirect.com> Newsgroups: borland.public.cppbuilder.database.ado References: <40e31878$1@newsgroups.borland.com> <40e3b857$1@newsgroups.borland.com> <40e42ca9@newsgroups.borland.com> Subject: Re: Auto Increment Question Date: Thu, 1 Jul 2004 20:31:13 +0400 Lines: 75 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: 213.234.218.42 Message-ID: <40e43c52@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1088699474 213.234.218.42 (1 Jul 2004 09:31:14 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.frii.net!newsfeed.frii.net!news.compaq.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail