question

Manoj Balakrishnan avatar image
Manoj Balakrishnan asked

SELECT * FROM OPENROWSET ('MSDASQL')

Hi, I tried to run the statement below in SQL Server 2008 64 Bit and i got the error. Statement : `SELECT * FROM OPENROWSET ('MSDASQL', 'Driver={Microsoft Text Driver (*.txt;*.csv)};DBQ=C:\LogReader\AccurateLogReader\;', 'SELECT * from Feeders.txt')` > Error: OLE DB provider "MSDASQL" for linked server "(null)" returned message "[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified". Msg 7303, Level 16, State 1, Line 3 Cannot initialize the data source object of OLE DB provider "MSDASQL" for linked server "(null)". Could you please help me how can i fix this issue. Thanks in Advance Manoj
sqldata-import
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Kev Riley avatar image
Kev Riley answered
I couldn't get the MSDASQL drivers to work, but got a result with the ACE drivers (NOTE I am on 64-bit so using the ACE drivers). It might be that I need the 64 bit version of MSDASQL..... < http://blogs.msdn.com/b/sqlforum/archive/2010/12/20/faq-why-cannot-64-bit-msdasql-access-a-csv-text-file.aspx>; SELECT * FROM OPENROWSET ( 'Microsoft.ACE.OLEDB.12.0', 'Text;Database=C:\LogReader\AccurateLogReader; ', 'SELECT * from Feeders.txt') If you are on 32-bit, maybe try SELECT * FROM OPENROWSET ( 'Microsoft.Jet.OLEDB.4.0', 'Text;Database=C:\LogReader\AccurateLogReader; ', 'SELECT * from Feeders.txt')
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Manoj Balakrishnan avatar image
Manoj Balakrishnan answered
Much appreciated. I tried using 'Microsoft.ACE.OLEDB.12.0' and it is working fine.. Cheers Manoj
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.