Visual Basic Development Bookmark and Share   
 Home > Visual Basic Language > Composite keys
 

Composite keys

Hi, I am facing a problem while trying to update records that have 2 or more fields as the primary key. Please can you suggest somethign to resolve this?

Rm
Sairema  Thursday, April 09, 2009 10:26 AM
Hi Sairema,

If you have more than oen fields as the primary key, you should put these primary-key fields in the where state when upadte:
update Person set manager = 'Mary' where id=1 and name ='edith'

Here the id and name fields are the primary keys.

Does this works for you? If you have any questions or concerns, please update the thread and we will have a further discussion.

Best Regards

Yichun Feng


Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
Yichun Feng  Monday, April 13, 2009 3:51 AM
Hi Sairema,

so what is your problem ? Do you get any exception / error message while trying to do this ?
Mark the thread as answered if the answer helps you. This helps others who have the same problem !
Heslacher  Thursday, April 09, 2009 10:38 AM
Hi Sairema,

If you have more than oen fields as the primary key, you should put these primary-key fields in the where state when upadte:
update Person set manager = 'Mary' where id=1 and name ='edith'

Here the id and name fields are the primary keys.

Does this works for you? If you have any questions or concerns, please update the thread and we will have a further discussion.

Best Regards

Yichun Feng


Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
Yichun Feng  Monday, April 13, 2009 3:51 AM

You can use google to search for other answers

Custom Search

More Threads

• Not so a Probleb but need help
• The web page must open before..
• Combobox.SelectedValue
• Access database + BLOB?
• Datagridviewtext column
• File Read Error
• How to get Maximum Record from database
• Dedicated administrator connection to sql server 2005
• Does anyone know of a Hyperbolic Tree component?
• Finding the internal Event IDs of a COM wrapped Custom Control?