Menu

SQLGetInstalledDrivers using unixODBC does not return anything.

Help
2013-09-12
2013-09-13
  • ameybarve15

    ameybarve15 - 2013-09-12

    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.

     
  • Nick Gorham

    Nick Gorham - 2013-09-12

    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

     
  • ameybarve15

    ameybarve15 - 2013-09-13

    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.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.