Identity Field Lost, when i make a post to the table

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
gilbosun

Identity Field Lost, when i make a post to the table

Post by gilbosun » Thu 17 Mar 2005 22:25

Hello:

Well, i have a litle problem when i do a post for the current table, i want to mention, that i don't use then INSERT like everyone use it, i only have a customer table, when i insert a new one, and click on the post button, the record is saved to the corresponding table, but the identity field appears with blank information, all the others fiels seems to be fine, but in my preview, don't.

Anyone can helpme with that

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Fri 18 Mar 2005 10:47

What are your values of SQLInsert and Options.QueryIdentity?

gilbosun

Identity Field Lost, when i make a post to the table

Post by gilbosun » Fri 18 Mar 2005 16:35

Hello:

Well, in fact i don't have any value for SQLInsert, because i never use it, i only match (in the server side) a TMSQuery with a DataSetProvider, and/on the client side i put a ClientDataSet with the corresponding DataSource, and then inside the code i put a close/open for the ClientDataSet, to obtain all the fields of the table.

Finally i tried to insert a record and works fine, but when i trid with another one, that's it the program indicate a key violation, because the identity field doesn's have any value.

By the way for the Options.QueryIdentity is checked to true???


Thanks

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Mon 21 Mar 2005 09:27

Identity-fields are a little applied for MIDAS applications.Try to use instead of these fields another method of generating unique key. For example, GUID.

Post Reply