create cursor curAllDBCTables (TablePath M, TableName C (40), Records I, Size I, Modify D) open database d:\cotton\tables\weight.dbc local lnI, lnTables, lnTable lnTables = ADBOBJECTS(laTables, "Table") for lnI = 1 to m.lnTables lnTable = adir(laTableInfo, FULLPATH(dbgetprop(laTables[m.lnI],"TABLE", "PATH"),dbc())) if m.lnTable = 1 && The table exists insert into curALLDBCTables (justpath(laTableInfo[1,1], ; laTables[m.lnI], ; GetReccount(laTableInfo[1,1], ; laTableInfo[1,2], ; laTableInfo[1,3]) endif nextWhere GetRecCount is my custom function:
******************************************************************** * Description.......: GetRecCount - gets reccount() using low-level functions * Calling Samples...: * Parameter List....: tcTableFullName, * Created by........: Nadya Nosonovsky 09/22/2004 1:47 pm * Modified by.......: ******************************************************************** lparameters tcTableFullName if vartype(m.tcTableFullName)<>"C" tcTableFullName = getfile('DBF','Select','&Choose',0,'Select table to check database') if empty(m.tcTableFullName) && User pressed cancel return '' endif endif local lnFh1, lcBuffer, lnReccount lnReccount = -1 lnFh1 = fopen(m.tcTableFullName) && To read if m.lnFh1 <> - 1 * Make sure that's VFP table lcBuffer = fread(m.lnFh1,1) if asc(m.lcBuffer) <> 0x30 * not VFP table = messagebox( "***NOT VFP TABLE***",48,'Error') else * Record Count - 3 bytes = fseek(m.lnFh1, 4, 0) lcBuffer = fread(m.lnFh1,3) lnReccount = asc(m.lcBuffer) endif = fclose(m.lnFh1) else =messagebox('File '+ m.tcTableFullName+' could not be opened',48,'Problem') endif return m.lnReccount