If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Delphi, C etc > DataAdapter Update and no primary key

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-10-04, 15:57
Kearney Kearney is offline
Registered User
 
Join Date: Nov 2003
Location: Scotland
Posts: 7
DataAdapter Update and no primary key

Hi,

Get this error message
"could not determine whcih columns uniquely identify the rows for "Table""

Works ok for Select and Insert. Problems arise when dealing with Update, Delete, due to no primary key in the table.

Is there a way of allowing a DataAdapter to Update to a Table without a Primary Key????

Your help would be most appreciated. This is a real show stopper. Thanks.

Stuart
Reply With Quote
  #2 (permalink)  
Old 01-14-04, 10:44
saxgirl saxgirl is offline
Registered User
 
Join Date: Jan 2004
Posts: 4
I had the same problem & couldn't figure out how to make it work with NO key, but it works fine with a composite key...e.g., in my case a record is uniquely identified by two fields (Site ID & Contact name). Neither field alone is enough. You can use all the fields in the table if you have to.
Reply With Quote
  #3 (permalink)  
Old 01-14-04, 14:30
Kearney Kearney is offline
Registered User
 
Join Date: Nov 2003
Location: Scotland
Posts: 7
Hi SaxGirl,

Up until yesterday, I would have completely agreed with you. Was on to microsoft support and they suggested using technique layed down at the website http://support.microsoft.com/?id=308055 – Go by Code Sample 2.

It's basically saying that the whole row is a primary key. i.e. that row will never be repeated, so therefore is unique. However, what most users can do is copy and paste from a previous row into the AddNewRow for DataGrid.

If they then save this to the db. Next time someone changes, any one of these rows, it'll change the other row as well.

Thanks for posting, and up until yesterday, I would have agreed. Please be sure to test your code to see if this loop hole is there. Can you let us know of your outcome.

Either way, you'll get to see a potential issue, or if yours works I could finally have my solution.

Thanks so much for posting Saxgirl,

Stuart
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On