How can understand that a Field is AutoIncrement Field?
How can understand that a Field is AutoIncrement Field?
I have a table on MS SQL SERVER, and table has a autoincrement field that s name is 'ID'. I open with clientdaset this table, but i can not understand ID Field is AutoIncrement or not.
I must define Field is AutoIncrement because i do some job about field type automatically. How can i understand that a field is autoincrement or not?
Thanks.
I must define Field is AutoIncrement because i do some job about field type automatically. How can i understand that a field is autoincrement or not?
Thanks.
hi, I think i can not explain exactly what i mean.Ikar wrote:For autoinc fields Field.AutoGenerateValue = arAutoInc is set.
Follow Steps
1. Create A Table
CREATE TABLE [dbo].[Table_Inc] (
[ID] [int] IDENTITY (1, 1) NOT NULL ,
[NAMA] [varchar] (50) COLLATE Turkish_CI_AS NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Table_Inc] WITH NOCHECK ADD
CONSTRAINT [PK_Table_Inc] PRIMARY KEY CLUSTERED
(
[ID]
) ON [PRIMARY]
GO
2.Create a Application
3.Drop a TSQLConnection, and connect to sql (with core dbexpress)
4.Drop TSQLQuery and set connection property
5.Drop TDatasetProvider, set DataSet property, set AllowCommandText True
6.Drop TClientDataSet, set providername property,
7. set Clientdataset CommandText as "SELECT * FROM Table_Inc"
8. set Active as True
9.Open Clientdataset Fieldeditor
10.Click Add All Fields
and when i look ID Field, ID Field's AutoGenerateValue property is arNone. And ID Field type is TIntegerField. Read Only property is false.
In normal, ID Field must be AutoIncField, and Reada only is true.
I want to learn this fields is auto increment or not?
Thanks
Murat Ak
I am trying to use the autoincrement feature of the column.
During an insert does your driver send a null value for this column when arAutoInc is specified and get the actual value from the server after the insert?
I can't get it to work this way. I specify arAutoInc at the TSQLDataSet.Field object do I need to specify it also at the ClientDataSet level?
During an insert does your driver send a null value for this column when arAutoInc is specified and get the actual value from the server after the insert?
I can't get it to work this way. I specify arAutoInc at the TSQLDataSet.Field object do I need to specify it also at the ClientDataSet level?