>DECLARE SHORT SQLRowCount IN ODBC32 ; > INTEGER StatementHandle, ; > INTEGER @RowCountPtr > >lhTest = SQLSTRINGCONNECT("dns=DemoTDat;") > >IF lhTest > -1 > lcSQL = "SELECT * FROM dbc.tables ORDER BY CreateTimeStamp" > lnResult = SQLEXEC(m.lhTest, m.lcSQL) && returns several hundred rows... obviously a good connection > > lnSQLResult = SQLRowCount(m.lhTest, @lnTally) && errors out > > SQLDisconnect(m.lhTest) >ENDIFThe handle you are using is the internal VFP handle, this might not be the same as the handle (SQL_HANDLE_STMT) expected by the ODBC driver API function. Do you know for certain that the VFP handle can readily be substituted as desired above?