Insert record w/SQL Server identity field 
Author Message
 Insert record w/SQL Server identity field

I'm using a TQuery component (live result set) to access a table on
MS-SQL Server. The primary key for the table is an identity
(auto-incrementing) column. When my delphi app attempts to insert a
record into the table (i.e. QueryMyQuery.InsertRecord), I get a
"record/key deleted" error. If I exit the app and re-enter, the record
does appear to get posted to the server, however. I've read Borland's
TI2955 - "Working with auto-increment field types", which says to use a
separate TQuery component to insert the record, then refresh the
dataset. But according to the Delphi on-line help, the refresh method
for TQuerys only works for local dBase/Paradox tables. How can I avoid
the error message and refresh my dataset to show the new record? I'm
using Delphi 2.0, BDE 3.5 and SQL Server 6.5 via ODBC client drivers.

Any help would be greatly appreciated!

   Matt Zuhlke

Mon, 16 Aug 1999 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. ms-sql-server identity field with delphi3

2. Problem with Identity field in Delphi 2, with ODBC SQL server 6.5 link

3. Unable to insert to MS-SqlServer table with IDENTITY field

4. Paradox autoinc fields vs MS SQL identity fields

5. MSSQL Identity columns, and Insert SQL

6. how to handle identity fields and mssql server??

7. Sql Server 6 & Identity columns

8. using @@IDENTITY from SQL-Server 6.0

9. Getting @@Identity from SQL Server via ODBC Driver

10. Identity (autincrement) primary key trouble with MS SQL Server

11. SQL Server IDENTITY Property

12. Help: Identity recovering and Disconnections with Delphi 2 and SQL Server and ODBC


Powered by phpBB® Forum Software