Main Board > Wish List

query version of ODBC-driver

(1/2) > >>

Thomas Bock:
I would like to query the version of the local ODBC-driver and the SQL-server.

Devon Austen:
Using the pxpsql command line client with --version will return the version.

pxpsql --version

You can also run the PxPlus Sql Server with a --version to get it's version

pxpsqlsvr --version

If on Windows you can hover over the pxpsqlodbc.dll or pxpsqlsvr.exe file to see the version. In this case it will look like 7.0.3.0 for 7.00.0003

On Windows you can also see the ODBC driver version in the Data Source Administrator window. Open a PxPlus ODBC DSN and go to the about tab. Before you create a DSN the ODBC version will appear beside the name of the driver as well.

For the PxPlus SQL Server you can open the pxpsconf.exe config app and go to about to see the version as well.

The version in these programs appears as 7.00.0003.

An ODBC client application can also query the version number using a SQLGetInfo call with the SQL_DBMS_VER property.

Does any of that get you what you want or are you looking for something different?

Thomas Bock:
I want to retrieve this information at runtime. SQLGetInfo sounds promising. Can you please post a sample? I can't find anything in the docs.

Stéphane Devouard:
Thomas,

I guess Devon refers to this function, which is probably implemented in the pxpsqlodbc.dll ?
https://docs.microsoft.com/en-us/sql/odbc/reference/syntax/sqlgetinfo-function?view=sql-server-ver15

I just found this other possibility to be quite simpler :

--- Code: ---->def object fs,"Scripting.FileSystemObject"
->? fs'GetFileVersion$("D:\PxPlus\SQL ODBC Driver (64-bit)\pxpsqlodbc.dll")
7.0.3.0

--- End code ---

You need to know first where the PxPlus ODBC driver has been installed
You can get that by querying the Registry key
HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\PxPlus® SQL ODBC Driver (64-bit)
And retrieve the Driver value

Regards

Devon Austen:
The SQLGetInfo call is a Windows API call and not a SQL query. Usually the application that implements a ODBC interface will use the SQLGetInfo call to get information about the ODBC driver to present to the user.

If you are writing your own ODBC client application you can use SQLGetInfo. If you are using an existing ODBC client application like SQL Server or Excel etc, you have to look if they provide you the driver version information (which it would get from our driver via the SQLGetInfo call).

What application are you using to access ODBC?

Navigation

[0] Message Index

[#] Next page

Go to full version