Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Linked Server

Author  Topic 

chriztoph
Posting Yak Master

184 Posts

Posted - 2010-10-13 : 22:36:40
Please Help!

first run:
executed this
1. exec sp_configure 'show advanced options', 1
2. reconfigure

3. exec sp_configure 'Ad Hoc Distributed Queries', 1
4. reconfigure

5. select * from OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=C:\Users\crlibrero\Desktop\PH_RPAGSTM_C_2830466_0503_USD.xls;',
'SELECT * From Sheet1$')

and it was successful

then i changed Microsoft.Jet.OLEDB.4.0 to Microsoft.ACE.OLEDB.12.0
and Excel 8.0 to Excel 12.0

and execute, i got the error:
OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)" returned message "The Microsoft Access database engine cannot open or write to the file ''. It is already opened exclusively by another user, or you need permission to view and write its data.".
Msg 7303, Level 16, State 1, Line 1
Cannot initialize the data source object of OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)".


and then i changed it back to the original
i got the error:
Msg 7399, Level 16, State 1, Line 1
The OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)" reported an error. The provider did not give any information about the error.
Msg 7303, Level 16, State 1, Line 1
Cannot initialize the data source object of OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)".

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2010-11-03 : 09:48:04
Make sure the file is closed or not accessed by any other applications when you run the query

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -