SQL Server data replication to access two-step walk _mssql

Source: Internet
Author: User
Tags access database

What we're talking about today is the actual steps of copying SQL Server data into an Access database, copying some of the data in the SQL Server database into an Access database that has the same main structure, not mentioning OpenRowset, Because the Access file and SQL Server are not on a single machine.

The initial idea is to use two recordsets, one to fetch data from SQL, and one to insert data into Access

Because there are more fields in the table, we 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 is a description of the access that SQL Server data is copied to, and hope you get something.

The above is a description of the access that SQL Server data is copied into, hopefully giving you some help in this regard.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.