How to return number of rows(Records) in a database file? I do not know what ODBC API function retrieves this value,So I have tried to add a counter field(I succeded)--> SQLStatement db "alter table main add column CounterNum COUNTER",0 Then I used SqlFetchScroll with SQL_FETCH_LAST as a parameter ,but I failed. in MSDN I read I must set the cursor attributes first,I tried invoke SQLSetStmtAttr,hStmt, SQL_ATTR_CURSOR_SCROLLABLE,.... it failed because of ?? wrong parameters. I 'll be gratefull for any help.Thanks. A.Nada
Posted on 2001-04-21 20:26:00 by A Nada
if you're just asking for a count of the number of rows in a table SELECT COUNT(My_Table_Primary_Key) AS Result FROM MyTable; will do it just fine. Else you'll need to provide a bit more detailed info
Posted on 2001-04-21 20:39:00 by Hiroshimator
Much Thanks Hiroshimator. Yes,I am just asking for a count of the number of rows in a table. I tried the this SQL syntax : SQLStatement db "select count (CounterNum) As Result from main",0 It succeded. I also have declared "Result dd ?" but when I retrieved the Result it was 0 Thanks again for help.
Posted on 2001-04-21 21:35:00 by A Nada
Much thanks Sir. With your help I managed to solve my problem.
Posted on 2001-04-23 01:20:00 by a nada