Copying access objects using .net

G

Guest

How do I program vb.net to copy a query or table from one MS Access database
to another?

I'd like to accomplish what import does when it copies Access objects
(primarily queries but some tables) from another database into the database
where the import action is selected---EXCEPT that I'd like to do this
externally with a VB.net program.
 
P

Paul Clement

¤ How do I program vb.net to copy a query or table from one MS Access database
¤ to another?
¤
¤ I'd like to accomplish what import does when it copies Access objects
¤ (primarily queries but some tables) from another database into the database
¤ where the import action is selected---EXCEPT that I'd like to do this
¤ externally with a VB.net program.

There are two options. You can use automation with Access and the TransferDatabase method for DoCmd:

http://support.microsoft.com/default.aspx?scid=kb;en-us;298174

Or, you can write code to recreate the objects in the destination database, which would require a
lot more work but can be done with ADO.NET.


Paul
~~~~
Microsoft MVP (Visual Basic)
 
G

Guest

Paul, thank you for your reply.

I have 11 users for this app, each in a different location. I have a vb.net
app which is used by each user to modify his/her respective Access data base.

Each time a user installs the latest version/release of the app, he/she gets
an updated program, an updated xml report file, and an updated test database.

The test database contains new queries that are used by new reports.

My problem is to get these new queries into the respective production
databases by having the user click on a button to do so.

So I'm relegated to doing this using ADO.net.

Could you give me a jump start?
 
P

Paul Clement

¤ Paul, thank you for your reply.
¤
¤ I have 11 users for this app, each in a different location. I have a vb.net
¤ app which is used by each user to modify his/her respective Access data base.
¤
¤ Each time a user installs the latest version/release of the app, he/she gets
¤ an updated program, an updated xml report file, and an updated test database.
¤
¤ The test database contains new queries that are used by new reports.
¤
¤ My problem is to get these new queries into the respective production
¤ databases by having the user click on a button to do so.
¤
¤ So I'm relegated to doing this using ADO.net.
¤
¤ Could you give me a jump start?

It might help to take a look at the Jet DDL SQL you can use to create table and query (Views and
Procedures) database objects:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnacc2k/html/acfundsql.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnacc2k/html/acintsql.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnacc2k/html/acadvsql.asp


Paul
~~~~
Microsoft MVP (Visual Basic)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top