I am passing an SQL statement from VB6 ("DELETE FROM tblNAME" to VFP 6 using ADO/ODBC. The table marks the records for deletion successfully but now how do I pack the table?
I don't THINK there is a 'PACK' command that you can use with an ODBC connection... BUT you could create a new table (which would not include the deleted records) then delete the original table and rename the new one.
Far from perfect, but it is what the code underlying a PACK would do anyway!
I'm running the FoxPro ODBC driver from Euphoria and not VB, but this should still work:
SQLCmd = "Pack CustTbl"
data = execDirectODBC(hconn,SQLCmd)
As long as the table "CustTbl" is not open by anyone else, it packs just fine.
Note, this isn't documented anywhere on the planet that I can find, I figured it out through Extreme Tinkering (tm). Too bad "zap CustTbl" doesn't work.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.