Skip to content

Commit

Permalink
Do not set DataTypeCompatibility=80 in ADO connection string with old…
Browse files Browse the repository at this point in the history
… 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 7c1b0c4
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions source/dbconnection.pas
Expand Up @@ -2140,11 +2140,15 @@ procedure TAdoDBConnection.SetActive(Value: Boolean);
'User ID='+Parameters.Username+';'+ 'User ID='+Parameters.Username+';'+
'Network Library='+NetLib+';'+ 'Network Library='+NetLib+';'+
'Data Source='+DataSource+';'+ 'Data Source='+DataSource+';'+
'Application Name='+AppName+';'+ 'Application Name='+AppName+';'
;
if Parameters.LibraryOrProvider = 'MSOLEDBSQL' then begin
// Issue #423: MSOLEDBSQL compatibility with new column types // 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 // 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? // Pass Database setting to connection string. Required on MS Azure?
if (not Parameters.AllDatabasesStr.IsEmpty) and (Pos(';', Parameters.AllDatabasesStr)=0) then if (not Parameters.AllDatabasesStr.IsEmpty) and (Pos(';', Parameters.AllDatabasesStr)=0) then
Expand Down

0 comments on commit 7c1b0c4

Please sign in to comment.