rockinhorse
Programmer
I need to import data from another MSAccess DB using VBA and ADO. The trouble I am having is keeping the autonumber ID field from erroring when trying to bring the same thing from the external db. Any ideas? Thanks
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
[blue]INSERT INTO YourTableName (FieldName1, FieldName2)
SELECT SourceFieldName1, SourceFieldName2
FROM SourceTableName IN 'Drv:\Path\FileName';[/blue]
To make things clear for the purpose of this thread:rockinhorse said:[blue]I still have to retrieve [purple]linked records[/purple] from associated tables by the old ID and then insert those into the target DB with the new corresponding ID.[/blue]
So . . . how about an [blue]append query[/blue] that gets its source data from an [blue]UnMatched Query[/blue] (setup properly, the unmatched would only return those records you don't have)?rockinhorse said:[blue]I am trying to import data from a similiar database and just append the records that I don't already have.[/blue]