StrataFrame Forum
Back
Login
Login
Home
»
StrataFrame Application Framework - V1
»
Business Objects and Data Access (How do I?)
»
Can you ZAP or PACK a vfp free table through BO?
Can you ZAP or PACK a vfp free table through BO?
Post Reply
Like
0
Can you ZAP or PACK a vfp free table through BO?
View
Flat Ascending
Flat Descending
Threaded
Options
Subscribe to topic
Print This Topic
RSS Feed
Goto Topics Forum
Author
Message
Marcel Heitlager
Marcel Heitlager
posted 15 Years Ago
ANSWER
Topic Details
Share Topic
Group: StrataFrame Users
Posts: 84,
Visits: 835
Hi,
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.
Can you do something like below but with the PACK or ZAP command? I know it's a stupid question but I'm stuck.
thanks,
Marcel
Dim LoConn As New OleDb.OleDbConnection
LoConn.ConnectionString = MicroFour.StrataFrame.Data.DataLayer.DataSources("myKey").ConnectionString
LoConn.Open()
Dim loCommand As New OleDb.OleDbCommand("SET DELETED OFF", loConn)
loCommand.ExecuteNonQuery()
Reply
Like
0
Marcel Heitlager
Marcel Heitlager
posted 15 Years Ago
ANSWER
Post Details
Share Post
Group: StrataFrame Users
Posts: 84,
Visits: 835
OK,
So I did some more digging and did the obvious thing after "PACK" didn't work:
LoConn.ConnectionString = MicroFour.StrataFrame.Data.DataLayer.DataSources("myKey").ConnectionString
LoConn.Open()
Dim loCommand As New OleDb.OleDbCommand("PACK myFreeTable.dbf", loConn)
loCommand.ExecuteNonQuery()
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.
Am I missing anything?
Thanks,
Marcel
Reply
Like
0
Michel Levy
Michel Levy
posted 15 Years Ago
ANSWER
Post Details
Share Post
Group: StrataFrame Users
Posts: 193,
Visits: 9K
Hi Marcel,
Are you sure your table is open EXCLUSIVE?
Reply
Like
0
Trent Taylor
Trent Taylor
posted 15 Years Ago
ANSWER
Post Details
Share Post
Group: StrataFrame Developers
Posts: 6.6K,
Visits: 6.9K
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.
Here is a list of supported commands:
http://msdn.microsoft.com/en-us/library/80x51c04(VS.80).aspx
Here is a sample of packing using OLEDB:
Dim cmd As New OleDbCommand("SET EXCLUSIVE ON;PACK MyTable.dbf")
MyBo.ExecuteNonQuery(cmd);
Don't hold me to it, but I think that will work.
Reply
Like
0
GO
Merge Selected
Merge into selected topic...
Merge into merge target...
Merge into a specific topic ID...
Open Merge
Post Reply
Like
0
Similar Topics
Post Quoted Reply
Reading This Topic
Login
Login
Remember Me
Reset Password
Resend Validation Email
Login
Explore
Messages
Mentions
Search