Because original dbx_mssql_connect.pas have smail bug in Delphi 2009 above.
so, I modify procedure MsSqlConnect fix below:
// Add procedure params procedure MsSqlConnect(SQLConnection: TSQLConnection;ServerVersion: Integer; const ServerName, DatabaseName, UserName, Password, [b]ApplicationName[/b]: string; ...);
in begin head.
begin SQLConnection.DriverName := {DbxXXDrv.pas}DbxOODBCDriverName; [b] {$IFDEF UNICODE} bUnicodeODBCAPI := True; bUnicodeDbxDriver := True; bAnsiFields := False; {$ENDIF}[/b] {$IF CompilerVersion < 17.50} ...
Add ApplicationName (can used search in SQL SERVER Profiler)
... //Values[SQLConnection.DriverName + ' TransIsolation'] := 'ReadCommited'; end; [b]sConnectionString := sConnectionString + ';APP='+ApplicationName;[/b] if (DNS_NAME = '') and (ServerName = '') then sConnectionString := sConnectionString + ';SERVER=127.0.0.1' ...
fix unicode block
... //bAnsiFields if not bUnicodeDbxDriver then begin // // DBX2 not supported TWideStringField // //if not bAnsiFields then // sConnectionString := sConnectionString + ';coEnableUnicode=1'; sConnectionString := sConnectionString + ';coEnableUnicode=0'; end else begin if not bAnsiFields then [b]sConnectionString := sConnectionString + ';coEnableUnicode=1';[/b] end; ...
Log in to post a comment.
Because original dbx_mssql_connect.pas have smail bug in Delphi 2009 above.
so, I modify procedure MsSqlConnect fix below:
in begin head.
Add ApplicationName (can used search in SQL SERVER Profiler)
fix unicode block