Click here to Skip to main content
15,303,572 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i am trying to copy records between 2 tables in 2 different database at different paths ..but i am getting error rs_bill_master not found

What I have tried:

Private Sub cmd_backup_bill_no_Click()
Dim cnn1 As New ADODB.Connection
Dim strsql As String
cnn1.Provider = "microsoft.jet.oledb.4.0"
cnn1.Open "data source=" & "d:\geniusbackup\data\backup.mdb;" & "Jet OLEDB:Database Password=1111"
Dim rs_backup_bill_master As New ADODB.Recordset

rs_backup_bill_master.Open "Bill_master", cnn1, adOpenStatic, adLockOptimistic, adCmdTable
strsql = " INSERT INTO rs_backup_bill_master SELECT * FROM rs_bill_master WHERE bill_master!status = 0;"
cnn1.Execute (strsql)
MsgBox "backup complete"
End Sub
Updated 23-Jan-22 7:31am

1 solution

Your SQL statement and code is very wrong.

See SELECT.INTO statement (Microsoft Access SQL) | Microsoft Docs[^]

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900