Linking Files and Select Unique Record Identifier

  • Thread starter Thread starter BruceF
  • Start date Start date
B

BruceF

I am using Access to create some reports, and I need to link to SQL tables.
I'm using DoCmd.TransferDatabase for the linking process. When I try to link
to one of the tables, a dialog box called Select Unique Record Identifier
pops up, and I have to choose a field(s) to be my primary key. How can I
program this so the primary key is selected automatically without a user
having to respond to this?

Here is the line of code that links to this table in case you need it:
DoCmd.TransferDatabase acLink, "ODBC", strCon, acTable, "AttendanceCode",
"dbo_AttendanceCode", , True

Thanks.
W
 
On Mon, 1 Feb 2010 06:03:01 -0800, BruceF

I'm not sure there is a way to do that. But the much better solution
would be to put a primary key on that table in SQL Server.

-Tom.
Microsoft Access MVP
 
Back
Top