• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1507
  • Last Modified:

TransferDatabase aclink, "ODBC Database" PopUp Dialog Box prompts "Select Unique Record Identifier"

DoCmd.TransferDatabase acLink, "ODBC Database", "ODBC;DSN=FileName+BIN;" & "DATABASE=" & CurrentProject.Path & "\" & DataPath & "\" & "File" & NDBCycle & "001.BIN", acTable, "RouteVias", "ROUTES"

SQL DROP TABLE ROUTES ensures no destination table exists prior to DoCmd

 When the DoCmd runs a PopUp Dialog Box prompts "Select Unique Record Identifier" and lists fields in table "ROUTES"

I select the first field "RecordIndex" and all is well.

How can I specify the First Field or a default as the Index without the Dialog Box
0
srlittle
Asked:
srlittle
1 Solution
 
Jim Dettman (Microsoft MVP/ EE MVE)PresidentCommented:
<<How can I specify the First Field or a default as the Index without the Dialog Box >>


 You need to create the tabdef and set indexes.  You cannot use the TransferDatabase command.

Jim.
0
 
Dale FyeCommented:
This is because you don't have a primary key in the tables you are trying to link to.

Best recommendation is to go back to the data source and establish primary keys.  Otherwise, you will need to establish those keys through this mechanism.
0
 
srlittleAuthor Commented:
After doing much research on connection strings I came to the conclusion that indeed tabdef and .dao connection was the most correct solution. However my application is small and not held to a higher standard of error checking so I elected to add

SendKeys ("{ESC}")             'this solves the "Select Unique Record Identifier" prompt issue

Good news is that I did get (re)educated on .dao and TableDefs
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now