Use of OpenRowSet and OpenDataSource in SQL Server

Source: Internet
Author: User
Tags ole

Select * From OpenRowSet ('sqloledb. 1','Mrp-Server'; 'sa '; '123', dbdata. DBO. tbg_gzzxzl)

Select .*
From OpenRowSet ('Microsoft. Jet. oledb.4.0 ',
'D:/aaa.xls '; 'admin'; '', data)
As
The following statement is successful, but not the last day: ole db providesProgram'Microsoft. Jet. oledb.4.0 'error.
[OLE/DB Provider returned message: Unrecognized database format 'd:/aaa.xls '.]
Select *
From OpenDataSource ('Microsoft. Jet. oledb.4.0 ',
'Data source = "D:/aaa.xls"; user id = admin; Password =; extended properties = Excel 5.0 ')... data $

Select *
From OpenDataSource ('Microsoft. jet. oledb.4.0 ', 'Data source = "C:/account.xls"; user id = admin; Password =; extended properties = Excel 5.0 ')... ABC $ insert into OpenDataSource ('sqloleddb', 'Data source = MRP-server; user id = sa; Password = 100 '). voutmmstdata. DBO. zcctest (cust_no, cust_name)
Select cust_no, cust_name
From OpenDataSource ('Microsoft. jet. oledb.4.0 ', 'Data source = "C:/111.xls"; user id = admin; Password =; extended properties = Excel 5.0 ')... getbom1 $ select * From OpenDataSource ('sqloledb', 'Data source = MRP-server; user id = sa; Password = 100 '). voutmmstdata. DBO. zcctest Delete from OpenDataSource ('sqloledb', 'Data source = MRP-server; user id = sa; Password = 100 '). voutmmstdata. DBO. zcctest
This statement can run successfully without a password in the ACCESS database. After the password is added, it cannot be written as follows: the ABC password. Select .*
From OpenRowSet ('Microsoft. Jet. oledb.4.0 ',
'D:/demo. dat '; 'admin'; 'abc', temp)
As
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.