﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » Business Objects and Data Access (How do I?)  » Can you ZAP or PACK a vfp free table through BO?</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Wed, 24 Jun 2026 03:57:42 GMT</lastBuildDate><ttl>20</ttl><item><title>Can you ZAP or PACK a vfp free table through BO?</title><link>http://forum.strataframe.net/FindPost23265.aspx</link><description>Hi,&lt;br&gt;
&lt;br&gt;
I'm trying to delete all the records in a VFP free table.  Doing the deleting is no problem, but I want them permanently deleted, like ZAP or PACK.&lt;br&gt;
Can you do something like below but with the PACK or ZAP command? I know it's a stupid question but I'm stuck.&lt;br&gt;
&lt;br&gt;
thanks,&lt;br&gt;
Marcel&lt;br&gt;
&lt;br&gt;
[codesnippet]&lt;br&gt;
Dim LoConn As New OleDb.OleDbConnection&lt;br&gt;
LoConn.ConnectionString = MicroFour.StrataFrame.Data.DataLayer.DataSources("myKey").ConnectionString&lt;br&gt;
LoConn.Open()&lt;br&gt;
Dim loCommand As New OleDb.OleDbCommand("SET DELETED OFF", loConn)&lt;br&gt;
loCommand.ExecuteNonQuery()&lt;br&gt;
[/codesnippet]</description><pubDate>Mon, 01 Jun 2009 06:59:37 GMT</pubDate><dc:creator>Marcel Heitlager</dc:creator></item><item><title>RE: Can you ZAP or PACK a vfp free table through BO?</title><link>http://forum.strataframe.net/FindPost23271.aspx</link><description>You will have to open the table exclusively, but there is more.  You need to create all of the commands that you wish to execute within the same session.  When trying to do a PACK or a ZAP, you need to set exclusive on and then execute the pack within the same query session.  Also, when dealing with VFP OLEDB, be sure to check the supported list.  Also, even if you are not on the latest version of VFP in development, get the most recent VFP OLEDB provider if you run into any issues.&lt;br&gt;
&lt;br&gt;
Here is a list of supported commands:&lt;br&gt;
[url=http://msdn.microsoft.com/en-us/library/80x51c04(VS.80).aspx]http://msdn.microsoft.com/en-us/library/80x51c04(VS.80).aspx[/url]&lt;br&gt;
&lt;br&gt;
Here is a sample of packing using OLEDB:&lt;br&gt;
[codesnippet]Dim cmd As New OleDbCommand("SET EXCLUSIVE ON;PACK MyTable.dbf")&lt;br&gt;
&lt;br&gt;
MyBo.ExecuteNonQuery(cmd);[/codesnippet]&lt;br&gt;
&lt;br&gt;
Don't hold me to it, but I think that will work. :)</description><pubDate>Mon, 01 Jun 2009 06:59:37 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Can you ZAP or PACK a vfp free table through BO?</title><link>http://forum.strataframe.net/FindPost23268.aspx</link><description>Hi Marcel,&lt;/P&gt;&lt;P&gt;Are you sure your table is open EXCLUSIVE?</description><pubDate>Sun, 31 May 2009 05:01:40 GMT</pubDate><dc:creator>Michel Levy</dc:creator></item><item><title>RE: Can you ZAP or PACK a vfp free table through BO?</title><link>http://forum.strataframe.net/FindPost23266.aspx</link><description>OK, &lt;br&gt;
&lt;br&gt;
So I did some more digging and did the obvious thing after "PACK" didn't work:&lt;br&gt;
&lt;br&gt;
[codesnippet]&lt;br&gt;
LoConn.ConnectionString = MicroFour.StrataFrame.Data.DataLayer.DataSources("myKey").ConnectionString&lt;br&gt;
LoConn.Open()&lt;br&gt;
Dim loCommand As New OleDb.OleDbCommand("PACK myFreeTable.dbf", loConn)&lt;br&gt;
loCommand.ExecuteNonQuery()&lt;br&gt;
[/codesnippet]&lt;br&gt;
&lt;br&gt;
Including the table name seems to work.  So I guess to do something like ZAP I just have to delete all the records and do a PACK and put it in a myBO.Zap function. &lt;br&gt;
Am I missing anything?  &lt;br&gt;
&lt;br&gt;
Thanks,&lt;br&gt;
&lt;br&gt;
Marcel</description><pubDate>Sat, 30 May 2009 01:15:08 GMT</pubDate><dc:creator>Marcel Heitlager</dc:creator></item></channel></rss>