Steven Wee wrote: > I used the SQL like:¡±select * from TestDB;¡±, I don¡¯ > t know how many columns in the result set, so I want use for() to bind > the data, how can I do it? http://www.freetds.org/userguide/samplecode.htm#E.G.SAMPLECODE.DBLIB.FETCH All the APIs have something similar to dbnumcols(). HTH. --jkl