Results 1 to 6 of 6
  1. #1
    Join Date
    Dec 2002
    Posts
    65

    Unanswered: PHP, Sybase, and unixODBC

    I'm upgrading one of our web servers (from RH 7.2 to RH 9) for our intranet and I inherited a 3rd party legacy app which uses unixODBC to connect to a Sybase server.

    Luckily, my predecessor left some documentation, unluckily it's very sparse. I have Apache (latest from 1.3 branch) / PHP (latest stable release) with unixODBC installed and PHP configured --with-unixODBC.

    The docs left behind say there are no driver installation files, just to copy:
    /usr/lib/dbodbc8_r.so.1 and /usr/lib/dbodbc8.so.1 and to make symlinks of these to dbodbc8.so and dbodbc8_r.so. I also pulled the odbc.ini and odbcinst.ini files from the old server.

    After pulling these files I went to test the connection and was getting errors so I pulled the following file as well:
    libdbtasks8.so.1

    and now I get the following error:
    odbc_connect(): SQL error: [unixODBC][Driver Manager]Driver's SQLAllocHandle on SQL_HANDLE_HENV failed, SQL state IM004 in SQLConnect

    where I'm stuck as various searches through google don't bring up anything helpful.

    Is there a place where I can get and install/compile a free Sybase ASA8 driver instead of pulling these files? Does anyone have any insight into this? Like I said this is a legacy app which I haven't had to touch since I've been here (at least regarding the db connection) and my predecessor is long gone. Any help would be appreciated.

    -b
    (I'm only available at the email address provided in my profile on weekdays, if you have questions or advice, during off hours use AIM). Also any views I provide here or on my website are mine and not representative of any views of my work, family, friends and sometimes even myself.

    http://www.bcyde.com

  2. #2
    Join Date
    Mar 2001
    Location
    Lexington, KY
    Posts
    606
    Thanks,

    Matt

  3. #3
    Join Date
    Dec 2002
    Posts
    65
    Thanks, for the reply MattR. I saw the pdf previously and the other link seems to be what I would need, except I believe the zip file is for ASA7 and I need ASA8. From all the testing I've been doing it seems that either the Sybase drivers I'm using are incompatible with RH9 or are incomplete. PHP and unixODBC seem to be working together fine so far and isql through unixODBC seems to get the DSN correct, just does not connect correctly. Unfortunately, the instructions my predecessor left stated to just copy the files I did, and didn't specify where I would be able to get a full source or package installation for linux. I'll browse the sybase site again for an ASA8 linux driver link and hopefully that will resolve the issue.

    Thanks again,
    -b
    (I'm only available at the email address provided in my profile on weekdays, if you have questions or advice, during off hours use AIM). Also any views I provide here or on my website are mine and not representative of any views of my work, family, friends and sometimes even myself.

    http://www.bcyde.com

  4. #4
    Join Date
    Mar 2001
    Location
    Lexington, KY
    Posts
    606
    You might try using FreeTDS, which is an open source TDS driver:
    http://groups.google.com/groups?q=AS...ase.com&rnum=2

    http://www.freetds.org/
    Thanks,

    Matt

  5. #5
    Join Date
    Dec 2002
    Posts
    65
    Thanks, I'll check that out as well. From an initial look it looks like unixODBC can work with the FreeTDS driver to connect to Sybase, correct (and not replace unixODBC)?

    Unfortunately, all this work is just for a legacy 3rd party app (so I can't just migrate the data to a different DB, or use something other than unixODBC) that I believe will end up going away in a couple months.

    Thanks a bunch, I appreciate your help.

    -b
    (I'm only available at the email address provided in my profile on weekdays, if you have questions or advice, during off hours use AIM). Also any views I provide here or on my website are mine and not representative of any views of my work, family, friends and sometimes even myself.

    http://www.bcyde.com

  6. #6
    Join Date
    Dec 2002
    Posts
    65
    Tried out freetds and that newsgroup posting you posted was very helpful as well. It's not up and running yet, but I do have hope . I'm currently getting a different error now:

    odbc_connect(): SQL error: [unixODBC][FreeTDS][SQL Server]Unable to connect to data source, SQL state S1000 in SQLConnect



    Which looks like unixODBC is attempting to use FreeTDS. I'm talking with the Sybase admin now, I'm just hoping it's something simple like I'm specifying the wrong port or similar....

    Just to be sure, it's ok that the error says [SQL Server] and not specifically [Sybase] ?

    -b
    (I'm only available at the email address provided in my profile on weekdays, if you have questions or advice, during off hours use AIM). Also any views I provide here or on my website are mine and not representative of any views of my work, family, friends and sometimes even myself.

    http://www.bcyde.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •