Article View: borland.public.cppbuilder.database.ado
Article #1389Re: Auto Increment Question
From: Kim Utley
Date: Thu, 01 Jul 2004 16:56
Date: Thu, 01 Jul 2004 16:56
44 lines
2297 bytes
2297 bytes
Viatcheslav, Okay, sorry found the problem. I was using "AutoIncrement" for the field name. Apparently it's a reserved word ;-) Thanks for your help, 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:
<40e4422f$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!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 11:56:06 -0500 Lines: 46 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: <40e4422f$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1088700975 65.205.74.2 (1 Jul 2004 09:56:15 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail