I have a database called Database which the VB6 program uses. I want to archive specific transaction records, i.e. send them from Database to another database called Archive which is of the same structure (same table names, fields, relationships) as Database.
The user selects an ID from a combo box and the matching record is archived on clicking on the command button cmdArchive.
This is what I have written so far.
ArchiveConn.Execute "INSERT INTO rsTransactionArchive rsTransaction" results in "Syntax error in INSERT INTO statement". How should I proceed with this?Code:Private Sub cmdArchive_Click() Dim rsTransaction as New ADODB.Recordset, rsTransactionArchive as New ADODB.Recordset Call OpenDatabase 'function to open Database Call OpenArchive 'function to open Archive rsTransaction.Open "SELECT * FROM tblProductTransaction WHERE TransactionID = " & cboID.Text, Conn 'Conn is connection to Database rsTransactionArchive.Open "tblProductTransaction", ArchiveConn 'ArchiveConn is connection to Archive ArchiveConn.Execute "INSERT INTO rsTransactionArchive rsTransaction" End Sub


Reply With Quote



