Error: “OLE DB provider ”MSDASQL“ for linked server ”(null)“ returned message ”[Microsoft][ODBC Driver Manager] Data source name not found …"

前端 未结 2 1293
误落风尘
误落风尘 2020-12-17 02:53

If I execute the following command:

select 
    * 
from 
    OpenRowset (
        \'MSDASQL\',
        \'Driver={Microsoft Text Driver (*.txt;*.csv)};Default         


        
2条回答
  •  北海茫月
    2020-12-17 03:26

    I just tried it on x64 Win7 and made it work. I think there are a couple problems.

    1. I believe you have to add a space between *.txt; and *.csv
    2. Don't include the path with the file name

    This worked:

    select * from OpenRowset('MSDASQL', 
             'Driver={Microsoft Text Driver (*.txt; *.csv)};DefaultDir=c:\;', 
             'select top 10 * from x.csv')
    

提交回复
热议问题