Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DELETE FROM through ODBC

Status
Not open for further replies.

timothy

Programmer
Mar 20, 2000
39
US
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?

Thanks in advance for your help.
 
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!

Martin

Regards

Griff
Keep [Smile]ing
 
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top