SQL database
hey guys,
im just learing how to program...im working through bob tabors tutorials for visual basic 2005 express edition. im on lesson 8 which starts to deal with SQL databases.
the problem comes when ive added a new database and when i add a new table and start uptting in information, i cant set a "primary key". the button for doing this is greyed out, as are all the other buttons in the "table designer" toolbar. does anyone have any ideas why all the buttons are greyed out?
thanks for any help!
[522 byte] By [
edallica] at [2007-12-16]
It's most likely that you have something other that the row you want to set as the primary key selected. In order for the button to be highlighted, you must select the row in the table designer which will be the primary key. Then, the button should highlight. In addition to the button, you can also use the menu or right click. The simplest way to do it is to right click on the column you want to set as the primary key. That will bring up a context menu. The top menu item will be "Set Primary Key". Simply select it and then it should show the row as the primary key. Hope this helps.
hey lance,
what you suggested partially helped. right clicking did allow me to set the primary key. but when the right-click menu was open the buttons in the top left of the screen in the "table designer" toolbar became coloured, but when the right click menu was closed the buttons became grey again.
i dont understand this at all. any help would be great!
If you have set focus inside the table designer, then, the icons should be enabled. I'm not exactly sure what is going on since I can't see. However, I suspect that somehow you must be setting focus outside the table designer once you right click and set the primary key.