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

Posted on 2012-08-23
Last Modified: 2012-08-24
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
Question by:srlittle
    LVL 56

    Accepted Solution

    <<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.

    LVL 47

    Expert Comment

    by:Dale Fye (Access MVP)
    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.

    Author Closing Comment

    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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Suggested Solutions

    MS Access 2003 or later To MySQL Migration Project Hello All, this is my second article in the category of MS-OFFICE Automation. In internet I am not able to find any comprehensive resource on the Migration of MS Access back-end to MySQL so I fin…
    We were having a lot of "Heartbeat Alerts" in our SCOM environment, now "Heartbeat" in a SCOM environment for those of you who might not be familiar with SCOM is a packet of data sent from the agent to the management server on a regular basis, basic…
    In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
    In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now