Transferring data from one database to another using DAO MFC classes
This article explains how to transfer data from one database to other using DAO MFC Classes.
The text of this article is not in this database — only its details are. The old site it was published on is gone, but the Internet Archive kept a copy: Transferring data from one database to another using DAO MFC classes

cuong nqPosted Dec 14, 2006, 6:41 PM EST
rs1 and trs in VB is: Set trs = New ADODB.Recordset // for ms access Set rs1 = New ADODB.Recordset // for sql server My Stuck is: I want to read a table (Ms Access) and insert into another table (sql Server) with the same value. And here is code in VB: Set rs1 = New ADODB.Recordset rs1.Open "select * from " & s1, con1, adOpenDynamic, adLockOptimistic ' Populating the created table with the values If trs.EOF = False Then trs.MoveFirst Do While trs.EOF = False rs1.AddNew For i = 0 To trs.Fields.Count - 1 rs1(i) = trs(i) Next rs1.Update trs.MoveNext Loop MsgBox "Data entered successfully", vbInformation End If My problem is rs1(i) = trs(i) I write it in VC++ is m_pRecordsetMsAccess[i]=m_pRecordsetMsSQL[i] but wrong, Help me Plz