MSDASQL provider problem : Data provider or other service returned an E_FAIL status

Hello,

We decided to move towards the ODBC drivers. I installed the ODBC Driver 13 for SQL Server. For that we desided to use MSDASQL provider for ODBC Drivers , our existing application uses ADO and SQL SERVER 2008 R2.
The problem is that I get <"Data provider or other service returned an E_FAIL status">, error message when I fetch (SELECT) any record , which has a column (nvarchar(MAX)) with a data length that happens to be greater than 132 (WHERE LEN(ContentSummary) > 132). The ContentSummary column is NVARCHAR(MAX). If the length is less than 132 , everything works well.
Also everything worked well when we used only the SQL Server Native client 11.0 OLE DB Provider (SQLNCLI11).

Could you please help to overcome this issue?

This is my connectionString:

String Con_String = "Provider=MSDASQL.1;Driver={SQL Server Native Client 11.0};Server=.;Persist Security Info=False;Auto Translate=True;Packet Size=4096;Database=HargalSite;Uid=;Pwd=;Use Procedure for Prepare=1;Auto Translate=True;Use Encryption for Data=False";

Thank you,
Victor

3 answers

Are you using encryption?

Please include full connectionstring in question.

Hi,

This is my connectionString:

String Con_String = "Provider=MSDASQL.1;Driver={SQL Server Native Client 11.0};Server=.;Persist Security Info=False;Auto Translate=True;Packet Size=4096;Database=HargalSite;Uid=;Pwd=;Use Procedure for Prepare=1;Auto Translate=True;Use Encryption for Data=False";

Not sure here but I would try remove the version specific Provider name i.e. remove the .1 from MSDASQL.1.

Also experimenting with Packet Size could be a bet.

Any success?