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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how toCode the VB to do backup data base

Status
Not open for further replies.

ph52

MIS
Oct 18, 2006
3
TH
Can any one give me sample of VB6-Coding to backup the selected row from a Tabel_A of DataBase DB1.MDB to the other Tabel_A in the other DB2.MDB
 
Two ADODB connections: one to DB1.MDB, another one to DB2.MDB
Code:
str = "SELECT abc FROM Table_A WHERE... "
rst.Open str, [blue]CnnDB1[/blue]

str = "INSERT INTO Table_A (abc)"
[blue]CnnDB2[/blue].Execute str

Have fun.

---- Andy
 
Use the IN section of a INSERT INTO sql Statement:

INSERT INTO Tabel_A
IN '' [;DATABASE=C:\MyDBs\DB2.Mdb;]
SELECT * FROM Tabel_A

 
But, looking again at the thread title, why not just copy the complete MDB file?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top