SQL Server data is copied to Access in two steps, serveraccess

Source: Internet
Author: User

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.

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.