Link Tables to SQL Server DB - Unique Record Identifier

  • Thread starter Thread starter Jason Gyetko
  • Start date Start date
J

Jason Gyetko

I'm linking tables to an SQL Server database programatically when my form
loads. The links work fine, but I'm getting prompted to "Select Unique
Record Identifier" when each tabe link is created. Is there anyway to
respond to this or set it programatically? Or is this something I need to
take care of within SQL Server? Here is what I'm running to link my table
right now:

DoCmd.TransferDatabase acLink, "ODBC Database", "ODBC;DSN=asset
data;UID=userid;PWD=password;LANGUAGE=us_english;DATABASE=asset data",
acTable, "Assets", "Assets"

Any help would be greatly appreciated. Thank you.
 
You need a PrimaryKey in your SQL Server Table. When you link to the Table
from Access, the PK will take care of it.

Also, Access seems to like a TimeStamp Field in the SQL Table.
 
Thanks, I created the tables by importing from Access. It must not have
brought over the Primary Keys.
 
Back
Top