Hello!
If i set TMSConnection.Options.Provider = prAuto and NativeClientVersion = ncAuto, is it possible to get actual values of used provider and native client version?
Thanks!
How to detect current provider and client version?
Re: How to detect current provider and client version?
To get the client and server version, you can use the following example:
Code: Select all
uses
MSClasses;
procedure TForm1.Button1Click(Sender: TObject);
var
St: String;
MSSQLConnection: TMSSQLConnection;
begin
MSSQLConnection := TMSSQLConnection(TDBAccessUtils.GetIConnection(MSConnection));
if MSConnection.Connected then begin
St := MSSQLConnection.GetServerVersionFull;
if st <> ':' then
Memo1.Lines.Add(St);
end;
if (MSConnection.Options.Provider <> prCompact) and
(MSConnection.Options.Provider <> prDirect)
then begin
St := MSSQLConnection.GetClientVersionFull + ': ' + MSSQLConnection.GetClientVersion;
if St <> ': ' then
Memo1.Lines.Add(St);
end;
end;
Re: How to detect current provider and client version?
Glad to see that the issue was resolved.
Feel free to contact us if you have any further questions about our products.
Feel free to contact us if you have any further questions about our products.