I just installed DB connect and am able to connect to Sybase. dbquery is returning all fields properly if I run select with int fields only. However, if the select has even one varchar field, then dbquery stops returning values the moment it encounters the first varchar field.
Ok, got the problem. I was using the Sybase driver to connect to the database. I thought the database was Sybase but it was actually SQL Anywhere. Hence the problem.
I installed the ODBC driver for SQL Anywhere and was able to connect through DB Connect using ODBC. All the queries are working fine now.