Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Urgent Opendatasource doesnt work from Query Analyser

Status
Not open for further replies.

QLearnerNow

Programmer
Jul 1, 2003
22
AU
Hi guys,

I want to query an excel file using OPENDATASOURCE command from my Query Analyser. I want to do this without using a linked server.

OPENDATASOURCE seems to be the right command but when I give this command in query analyser

SELECT *
FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
'Data Source="c:\Finance\account.xls";User ID=;Password=;Extended properties=Excel 8.0')...[xactions$]

I get an error stating that the object does not exist
account.xls has an xactions worksheet.
I have tried without brackets and $ sign

the excel worksheet if from Excel2000 tho would this be a reason why this is happening?

If any one has any clues or can reconstruct this query for me please do.

I appreciate any help provided

Regards,

QLearnerNow
 
I think you want OPENROWSET rather than OpenDataSource.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top