Skip to content
Permalink
Browse files

Do not set DataTypeCompatibility=80 in ADO connection string with old…

… SQLOLEDB driver. Probably solves some connection issues, see https://www.heidisql.com/forum.php?t=35208
  • Loading branch information
ansgarbecker committed Jan 3, 2020
1 parent c9d3d3c commit 7c1b0c4f03277d6a1eca0642761fe159eab20c1f
Showing with 7 additions and 3 deletions.
  1. +7 −3 source/dbconnection.pas
@@ -2140,11 +2140,15 @@ procedure TAdoDBConnection.SetActive(Value: Boolean);
'User ID='+Parameters.Username+';'+
'Network Library='+NetLib+';'+
'Data Source='+DataSource+';'+
'Application Name='+AppName+';'+
'Application Name='+AppName+';'
;
if Parameters.LibraryOrProvider = 'MSOLEDBSQL' then begin
// Issue #423: MSOLEDBSQL compatibility with new column types
// See https://docs.microsoft.com/en-us/sql/connect/oledb/applications/using-ado-with-oledb-driver-for-sql-server?view=sql-server-2017
'DataTypeCompatibility=80;'
;
// Do not use with old driver, see https://www.heidisql.com/forum.php?t=35208
FAdoHandle.ConnectionString := FAdoHandle.ConnectionString +
'DataTypeCompatibility=80;';
end;

// Pass Database setting to connection string. Required on MS Azure?
if (not Parameters.AllDatabasesStr.IsEmpty) and (Pos(';', Parameters.AllDatabasesStr)=0) then

0 comments on commit 7c1b0c4

Please sign in to comment.
You can’t perform that action at this time.