OpenRowSet Problem

Last Post 19 Mar 2009 12:35 PM by Balance. 0 Replies.
AddThis - Bookmarking and Sharing Button
Author Messages
New Member
New Member

19 Mar 2009 12:35 PM
I've enabled "Ad Hoc Distributed Queries" on the server but whenever I run this:

select * from OpenRowset('MSDASQL', 'Driver={Microsoft Text Driver (*.txt; *.csv)};
DefaultDir=C:\log;','select * from acct-2009-03-17.csv')

I get this error:
OLE DB provider "MSDASQL" for linked server "(null)" returned message "[Microsoft][ODBC Text Driver] Syntax error in FROM clause.".
Msg 7321, Level 16, State 2, Line 1
An error occurred while preparing the query "select * from acct-2009-03-17.csv" for execution against OLE DB provider "MSDASQL" for linked server "(null)".

From BOL:
"This method is an alternative to accessing tables in a linked server and is a one-time, ad hoc method of connecting and accessing remote data by using OLE DB."

Yet, the error message seems as if I need to register the server as a linked server?

Can someone shed some light?


Acceptable Use Policy