Nearly there connecting to ASA8 - but need final bit of help

Alex Lake <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <[email protected]>
Trying to connect to an ASA8 DB from an Ubuntu machine using FreeTDS.

After a bit of faffing around (and discovering that the FreeTDS heading 
is the DATABASE name, not the server name) I can connect with the isql 
commandline utility.

My files:

------- /etc/odbcinst.ini 
----------------------------------------------------------------------
[FreeTDS]
Description     = TDS driver (Sybase/MS SQL)
Driver          = /usr/lib/odbc/libtdsodbc.so
Setup           = /usr/lib/odbc/libtdsS.so
CPTimeout       =
CPReuse         =
UsageCount      = 2
------- /etc/odbc.ini 
--------------------------------------------------------------------------
[bh2_m7003]
Driver          = FreeTDS
Servername      = bh2_m7003
Port            = 2638
TDS_version     = 4.2
------- /etc/freetds/freetds.conf 
--------------------------------------------------------------
[global]
         # TDS protocol version
;       tds version = 4.2

         # Whether to write a TDSDUMP file for diagnostic purposes
         # (setting this to /tmp is insecure on a multi-user system)
;       dump file = /tmp/freetds.log
;       debug flags = 0xffff

         # Command and connection timeouts
;       timeout = 10
;       connect timeout = 10

         # If you get out-of-memory errors, it may mean that your client
         # is trying to allocate a huge buffer for a TEXT field.
         # Try setting 'text size' to a more reasonable limit
         text size = 64512

[bh2_m7003]
host = 192.168.1.90
port = 2638
tds version = 4.2
textsize = 64512
-----------------------------------------------------------------------------------------------

Now when I do:
isql bh2_m7003 dba <password>

I get:

+---------------------------------------+
| Connected!                            |
|                                       |
| sql-statement                         |
| help [tablename]                      |
| quit                                  |
|                                       |
+---------------------------------------+
SQL>

Which is encouraging, but if I enter the SQL command "select 0", I get 
an error "SQLRowCount returns -1"

If I say "help" then I do get a list of tables
If I say "help <tablename>" then I get the table definition

Furthermore, in PHP, I'm doing this:

         $dbh = new 
PDO($dbConfig['db_dsn'],$dbConfig['db_user'],$dbConfig['db_password']);
         $sql="SELECT 0;";
         $x = $dbh->prepare($sql,array(PDO::ATTR_CURSOR => 
PDO::CURSOR_FWDONLY));
         $x->execute();
         if ($x->errorCode()==0) {
            while ($row = $x->fetch(PDO::FETCH_ORI_NEXT, 
PDO::FETCH_ASSOC)) {
                 echo "data=".$row[0];
             }
         }

And it connects, but is similarly unable to access the data

When I look at the DBServer console, the connection information suggests 
that I'm using CT-Library (which I believe is some Sybase-specific 
alternative to odbc) which is slightly unusual

I feel I'm nearly there, but that's not good enough!

Any ideas?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.