I just tried you rcode here with 2.3.2pre and it worked just fine, and displayed the entries in odbcinst.ini.
I would check its linking to the libodbcinst.so you expect, use strace to check its opening the ini file you expect, and failing that show the contents of you odbcinst.ini file and I will see if there is anything in there that will cause a problem
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks Nick, I also tried running my code against latest unixODBC library, and it prints list of installed drivers correctly.
But when I run against older version (uknown version) I do not get any output.
Attaching below output of strace file for the failing SQLGetInstalledDrivers.
Below in the output.txt file I am seeing these two lines
open("/export/pnq-gst-dev02a/users/abarve/cheetah_dev_May13/build-artifacts/linux/sqlfire/odbc/64/524636832", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/export/pnq-gst-dev02a/users/abarve/cheetah_dev_May13/build-artifacts/linux/sqlfire/odbc/64/524636832", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 3
My odbcinst.ini file is present at /export/pnq-gst-dev02a/users/abarve/cheetah_dev_May13/build-artifacts/linux/sqlfire//odbc/64/ path.
Below is my code for getting list of all installed drivers
char buf[1024];
char* drivers= buf;
if (!SQLGetInstalledDrivers(buf, 1024, NULL))
printf("Error");
while (*drivers)
{
printf("%s\n", drivers);
drivers += strlen(drivers) + 1;
}
and SQLGetInstalledDrivers returns true.
I just tried you rcode here with 2.3.2pre and it worked just fine, and displayed the entries in odbcinst.ini.
I would check its linking to the libodbcinst.so you expect, use strace to check its opening the ini file you expect, and failing that show the contents of you odbcinst.ini file and I will see if there is anything in there that will cause a problem
Thanks Nick, I also tried running my code against latest unixODBC library, and it prints list of installed drivers correctly.
But when I run against older version (uknown version) I do not get any output.
Attaching below output of strace file for the failing SQLGetInstalledDrivers.
Below in the output.txt file I am seeing these two lines
open("/export/pnq-gst-dev02a/users/abarve/cheetah_dev_May13/build-artifacts/linux/sqlfire/odbc/64/524636832", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/export/pnq-gst-dev02a/users/abarve/cheetah_dev_May13/build-artifacts/linux/sqlfire/odbc/64/524636832", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 3
My odbcinst.ini file is present at /export/pnq-gst-dev02a/users/abarve/cheetah_dev_May13/build-artifacts/linux/sqlfire//odbc/64/ path.