PxPlus User Forum

Twitter Twitter Twitter

Author Topic: query version of ODBC-driver  (Read 1510 times)

Thomas Bock

  • Diamond Member
  • *****
  • Posts: 177
    • View Profile
query version of ODBC-driver
« on: March 03, 2022, 09:11:40 AM »
I would like to query the version of the local ODBC-driver and the SQL-server.

Devon Austen

  • Administrator
  • Diamond Member
  • *****
  • Posts: 382
  • Don’t Panic
    • View Profile
    • PVX Plus Technologies
Re: query version of ODBC-driver
« Reply #1 on: March 03, 2022, 10:57:55 AM »
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?
Principal Software Engineer for PVX Plus Technologies LTD.

Thomas Bock

  • Diamond Member
  • *****
  • Posts: 177
    • View Profile
Re: query version of ODBC-driver
« Reply #2 on: March 04, 2022, 02:00:38 AM »
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

  • Diamond Member
  • *****
  • Posts: 122
  • PxPlus guru with skills in PHP, JS, C#, Java
    • View Profile
    • Stéphane's Web Resume
Re: query version of ODBC-driver
« Reply #3 on: March 04, 2022, 06:13:13 AM »
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: [Select]
->def object fs,"Scripting.FileSystemObject"
->? fs'GetFileVersion$("D:\PxPlus\SQL ODBC Driver (64-bit)\pxpsqlodbc.dll")
7.0.3.0

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
« Last Edit: March 04, 2022, 06:15:20 AM by Stéphane Devouard »
Stéphane Devouard
Portfolio | Work

Devon Austen

  • Administrator
  • Diamond Member
  • *****
  • Posts: 382
  • Don’t Panic
    • View Profile
    • PVX Plus Technologies
Re: query version of ODBC-driver
« Reply #4 on: March 04, 2022, 08:35:23 AM »
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

  • Diamond Member
  • *****
  • Posts: 177
    • View Profile
Re: query version of ODBC-driver
« Reply #5 on: March 07, 2022, 07:29:26 AM »
Stéphane

That works pretty good. Thank you.