Linking Files and Select Unique Record Identifier

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
 
T

Tom van Stiphout

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top