Click here to Skip to main content
15,885,216 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,
I have an access database and connected to a Delphi application which use adoconnection, ado dataset and datasource to connect to the database, I use a db navigator to insert update delete etc., the problem is (access database has a primary key) that I have to insert primary key value manually when inserting a new record or else I get an error about a "double value in a unique field" and explains something about the primary key (error is in Greek so I trnslate it as exact as I can). Any ideas on how to insert the primary key automaticaly when I add a new record?

Thank you
Kyriakos
Posted

1 solution

Hi, you can change your field datatype to AutoNumber so after Inserting to the dataset the primary key can fill with new number automatically and then you can post data to the table.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900