Consolidate SQL data and access data into one dataset

Source: Internet
Author: User
Tags access database
access| data Sometimes we want to get a part of the data in the SQL database, while the other part of the data in the Access database, but sometimes it is necessary to link the data in these two databases to query, it is a good way to integrate them into a data collection. By following this procedure, you can combine SQL data and access data with only SQL connection database statements

First of all, you need to use the account with the database administrator to execute the following script 01_addlinkserver.sql,01_addlinkserver.sql's contents are as follows:

Use master

EXEC sp_addlinkedserver
@server = ' Valinkmdb ',
@srvproduct = ',
@provider = ' microsoft.jet.oledb.4.0 ',
@datasrc = ' C:\McMo.mdb '
Go

EXEC sp_addlinkedsrvlogin
@rmtsrvname = ' Valinkmdb ',
@useself = ' false '
Go

Valinkmdb is a mock Access database that confirms security on the Enterprisemanager of SQL Server-linked server > projects,
Please make sure Valinkmdb's entry is made. Then you can query the Aceess database directly on the SQL Query Analyzer, for example: SELECT * from Valinkmdb...test, where test is the name of the table you want to query in the Access database, Of course you can also make a joint query at this time, for example: SELECT * from Valinkmdb...test inner join sqldatabase on sqldatabase. Number = test. number

You can apply in ASP or. NET or other languages

If you have any questions, please ask for a common communication



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.