query version of ODBC-driver

Started by Thomas Bock, March 03, 2022, 09:11:40 AM

Previous topic - Next topic

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 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?
Principal Software Engineer for PVX Plus Technologies LTD.

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


I guess Devon refers to this function, which is probably implemented in the pxpsqlodbc.dll ?

I just found this other possibility to be quite simpler :

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

You need to know first where the PxPlus ODBC driver has been installed
You can get that by querying the Registry key
And retrieve the Driver value

Stéphane Devouard
Portfolio | Work

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?
Principal Software Engineer for PVX Plus Technologies LTD.

Thomas Bock


That works pretty good. Thank you.