Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have 2 computers, A and B.

On computer A I have installed sqlserver 2005 and I have enabled Ad Hoc queries.

On computer B I have an excel file, MyExcel.xls.

On comp B I have installed only SQL Server Management Studio and it can access the databases on computer A

On computer B I�m trying to select the data from that excel file(witch I remind you is on computer B) using the following query:

 

select *
from  
OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
 'Data Source="\\ComputerB\Share\MyExcel.xls";user id=myUser;password=myPassword;
Extended properties=Excel 8.0')...Sheet1$

 

When I parse this query I got the message:

�Ad hoc access to OLE DB provider 'Microsoft.Jet.OLEDB.4.0' has been denied. You must access this provider through a linked server.�

 

I red somewhere to add the DissAllowAdHocAccess in the registry under

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL1\Providers\Microsoft.Jet.Oledb.4.0

 

I did that and now I get the error:

 

OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)" returned message "Cannot start your application. The workgroup information file is missing or opened exclusively by another user.".

Msg 7399, Level 16, State 1, Line 1

The OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)" reported an error. Authentication failed.

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)".

 

In conclusion:

How can I use ad hoc queries from remote computers accessing a SQL Server?

Thanks

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...