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