Integrate SQL data and access data into a dataset _ MySQL

Source: Internet
Author: User
Sometimes we want to obtain part of the data in the SQL database, while the other part of the data in the access database, but sometimes we need to associate the data in the two databases for query, integrating them into a dataset is undoubtedly a good method. follow the steps below to Access SQL data only when SQL is connected to database statements.

Sometimes we want to obtain part of the data in the SQL database, while the other part of the data in the access database, but sometimes we need to associate the data in the two databases for query, integrating them into a dataset is undoubtedly a good method. follow the following steps to perform a joint query of SQL data and access data when only SQL statements are connected to the database.

First, you need to use an account with database administrator permissions to execute the following script 01_AddLinkServer. SQL, and the content of 01_AddLinkServer. SQL is as follows:

Use master

EXEC sp_addmediaserver
@ Server = 'valinkmdb ',
@ Srvproduct = '',
@ Provider = 'Microsoft. Jet. OLEDB.4.0 ',
@ Datasrc = 'C: \ McMo. mdb'
GO

EXEC sp_add1_srvlogin
@ Rmtsrvname = 'valinkmdb ',
@ Useself = 'false'
GO


VALINKMDB is a simulated access Database. check enterprenterprenterprenterprenterprenterprenterprenterprenterprenterprenterprenterprenterprenterprenterpr- link to the server> project,
Make sure that the entry of VALINKMDB is created. Then you can directly query the data in the aceess database on the SQL query analyzer, such as: select * from VALINKMDB... test: the name of the table you want to query in the access database. of course, you can perform a joint query at this time, for example: select * from VALINKMDB... test inner join sqldatabase on sqldatabase. number = test. number

You can apply it in asp,. net, or other languages.

If you have any questions, contact us.

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.