
Can I use an SQL action query to transfer data between DIFFERENT Access .mdb files
Hi guys:
I agree attaching two databases to a single mdb file could make things easier.
If you are sure you want to do it in different way, here is an option.
In your sql statements, specify the full path of the mdb file and use IN keyword.
for example:
SELECT * FROM customer WHERE CustomerID BETWEEN 1 AND 1000 IN
c:\MSOffice43\Access\Samples\NWind.mdb
I did this once and I can not actually remember if you should use quote signs to enclose
the database name. But I think you can search for IN keyword in your on-line help, or
simply try it out on your VB environment.
rgds
Jeff Hong YAN
Quote:
> > Please help.
> > I am writing a program that takes vegetation data from one table in one
> > Access *.mdb file and matches it with regional data in a different Access
> > database. As a consequence I need to insert the new veg data into the
> > regional database for matching. How can I specify the path as well as
> > table name from which to get the data in the SQL for my INSERT INTO action
> > query. If this isn't possible will I have to loop through the source
> > recordset and use AddNew, Update etc to add the copy the records between
> > databases ? Many thanks. Simon Smart.
> You'll find things much easier to cope with if you just deal with *one*
> database. Pick one, and use MS-Access to Attach the relevant table(s), from
> the other database, to it. Your program will then no longer need to worry
> about pathnames in SQL since all the tables will appear to come from the
> same database.
> --
> Jacobin's Chare http://tatpurusa.octacon.co.uk/
> Newcastle upon Tyne BB 74 A4 EF 03 F8 44 C1 F3 75 FE C6 7E F9 6E 43
> > Please help.
> > I am writing a program that takes vegetation data from one table in one
> > Access *.mdb file and matches it with regional data in a different Access
> > database. As a consequence I need to insert the new veg data into the
> > regional database for matching. How can I specify the path as well as
> > table name from which to get the data in the SQL for my INSERT INTO action
> > query. If this isn't possible will I have to loop through the source
> > recordset and use AddNew, Update etc to add the copy the records between
> > databases ? Many thanks. Simon Smart.
> You'll find things much easier to cope with if you just deal with *one*
> database. Pick one, and use MS-Access to Attach the relevant table(s), from
> the other database, to it. Your program will then no longer need to worry
> about pathnames in SQL since all the tables will appear to come from the
> same database.
> --
> Jacobin's Chare http://tatpurusa.octacon.co.uk/
> Newcastle upon Tyne BB 74 A4 EF 03 F8 44 C1 F3 75 FE C6 7E F9 6E 43