SQL Server (OpenRowSet function) reads data from a file (. DBF) and returns the data as a row set.

Source: Internet
Author: User

One-time temporary Method for connecting to and accessing remote data using ole db: read data from a file and return the data as a row set

You can use OpenRowSet to access remote data in the ole db data source only in the following situations: the disallowadhocaccess registry option of the specified access interface has been explicitly set to 0, the advanced configuration options of ad hoc distributed queries are enabled. If these options are not set, ad hoc access is not allowed by default.

 

-- Copy the data in test. DBF to the temp table (automatically created by the database ).

Select * into temp from
OpenRowSet ('Microsoft. Jet. oledb.4.0 ', 'dbase 5.0; database = D: \ datebase \', 'select * from [test. DBF] ')

Note:"Select * from [test. DBF]"Medium"Test. DBF"The length of the file name (excluding the extension) cannot exceed 8 bits; otherwise, a message is displayed.Object not found
For details, refer to msdn

 

For test. DBF for testing, click here to download: test.rar

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.