SQL Server data is copied to Access in two steps, serveraccess
Today, we will focus on the actual operation steps of copying SQL Server data to the Access database, and copying some data from the SQL Server database to the Access database, the main structure of the table is the same. Do not use openrowset because the Access file and SQL Server are not on the same machine.
The initial idea is to use two recordsets, one for retrieving data from SQL, and the other for inserting data into Access.
Because the table has many fields, you have to use a loop.
While (! M_pRecordset_ SQL-> adoEOF) {m_pRecordset_access-> AddNew (); for (int I = 0; I <m_pRecordset_ SQL-> Fields-> Count; I ++) {vValue = m_pRecordset_ SQL-> GetCollect (_ variant_t (long) I); m_pRecordset_access-> PutCollect (_ variant_t (long) I), vValue );} m_pRecordset_access-> Update (); m_pRecordset_ SQL-> MoveNext ();}
The above content is an introduction to SQL Server Data Copying to Access. I hope you will have some gains.
The above content is the description of the Access to which SQL Server data is copied. I hope it will help you in this regard.