Question : OLE DB provider 'MSDASQL' reported an error. The provider did not give any information about the error.

I get the following error when I execute the following statement

SELECT            *
FROM            OpenRowset('MSDASQL', 'Driver={Microsoft Text Driver (*.txt; *.csv)}; DefaultDir=C:\temp;','select * from domainUser4.csv')

Server: Msg 7399, Level 16, State 1, Line 1
OLE DB provider 'MSDASQL' reported an error. The provider did not give any information about the error.
OLE DB error trace [OLE/DB Provider 'MSDASQL' IColumnsInfo::GetColumnsInfo returned 0x80004005:  The provider did not give any information about the error.].

Did  a search in Google but returned nothing usefull, anyone any idea?

Answer : OLE DB provider 'MSDASQL' reported an error. The provider did not give any information about the error.

Microsoft has a support page on the problem.  Here are the details:

CAUSE
The Jet engine needs to create temporary files. To create the temporary files, the Jet engine uses the TEMP and TMP system environment variables. If the TEMP and TMP system environment variables do not exist, Jet uses the %WINDIR% folder. If the SQL Server service account does not have permissions to create, write, delete and read files in the %WINDIR% folder, or to the folder pointed to by the TEMP or TMP system environment variable, the error occurs.

WORKAROUND
To work around this problem, use of the the following two methods.

Method 1
Configure the TEMP and TMP system environment variables to point to a folder (for instance, C:\TEMP).
Set the permissions to the SQL Server service account on this folder as Full Control.
Restart the server.

Note In addition to granting full control to the SQL Server service account, any user that connects to the computer that is running SQL Server by using Windows Authentication must also be granted full control to the same TEMP and TMP directories that the SQL Server service account uses. Before you instantiate the OLEDB provider, SQL Server impersonates the account that is connecting to the computer that is running SQL Server if it is using a trusted connection.

Method 2
If there is not a TEMP or TMP system environment variable, set the permissions to the SQL Server service account on the %WINDIR% folder as Full Control -or-

Make the SQL Server service account a member of a group that has such permissions on the %WINDIR% folder.

Here is a link to the full article:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;296711
Random Solutions  
 
programming4us programming4us