Insert a whole datatable

Q

Q. John Chen

I have two access database (with identical schema). One is the master
and the other is SHOULD be a subset of master data (Let call them
MasterDB and SubDB

The user enters data into the SubDB and I need to bring the new
changes to the MasterDB. Traditionally, I can get a the new changes
(into a dataTable). Loop through all the rows and insert them into the
MasterDB ONE AT A TIME.

My question: IS THERE A BETTER WAY?

For SQL Server, there is a SqlBulkCopy but I am dealing with MS
Access.

In my case, performance is not an issue, I just want write less
code.

Thanks

John
 
W

William \(Bill\) Vaughn

I don't know that JET/Access supports replication, but that's the direction
I would take. This is supported (perhaps to the extent you need) with SQL
Server Compact Edition. Writing your own merge routine can be
tricky--especially with JET.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
 
Q

Q. John Chen

I don't know that JET/Access supports replication, but that's the direction
I would take. This is supported (perhaps to the extent you need) with SQL
Server Compact Edition. Writing your own merge routine can be
tricky--especially with JET.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speakerwww.betav.com/blog/billvawww.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visitwww.hitchhikerguides.netto get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
---------------------------------------------------------------------------­--------------------------------------------









- Show quoted text -

Thanks for the response. The access was using replication for sync
data - What a mess! I got involved just because of this.

While the criteria for the new changes of the data is not hard to
define, the table is so wide that I don't want write all the arguments
to call the Insert (which is generate by DataSet design and saved my
half the time). Loop is not really too bad compare to all the columns.

I DID find a solution for MY problem. Simply create another access
database and prelink all the tables. Then I can just do "select
into .."

Thanks

Johhn
 

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