Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

keep primary key on import of SQL database

Status
Not open for further replies.

xsnrg

Technical User
Jun 15, 2004
44
US
I use a TransferDatabase code to automate importing SQL tables into external backend Access databases...

Code:
DoCmd.TransferDatabase acImport, "ODBC Database", _
    "ODBC;DSN=eProj;UID=EProjUser;PWD=EPr0jUs3r;LANGUAGE=us_english;" _
    & "DATABASE=eProjRpt", acTable, "dbo.TaskAssignment", "dbo_TaskAssignment"

When I did the import manually, the primary key remained. Now there is no primary key... I assume ALL indexes are removed.

I need the PK for some of my other queries and actions... How do I automatically reassign these PKs to my tables?


McLean Jones
buddycenters.org
"Believing is Seeing
 
Take a look at the CREATE INDEX sql instruction.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
I don't know SQL outside of the basic I perform in Access VBA. Where would I find this instruction. I'm a quick learner if I have something to read.

McLean Jones
buddycenters.org
"Believing is Seeing
 
In the Jet SQL help file.
If you can't open it inside access, search your computer for jet*.chm files.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Any other on-line places to look. My help files are screwed up on my machine. And I did find this file in a search but still can't open it... I get this error...

tkSQLHelpError.jpg



McLean Jones
buddycenters.org
"Believing is Seeing
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top