Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to reindex and pack from executable
Message
From
09/09/2004 10:36:14
 
 
To
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Other
Title:
How to reindex and pack from executable
Miscellaneous
Thread ID:
00940642
Message ID:
00940642
Views:
121
Hello Cetin,

Please Can you help me on this:

I am working on VB with Foxpro table.

I am using oledb connection object with free table.

Please can you tell me how can i reindex a table and pack via Visual Basic application.
The problem is i upload loads of record into ocdata.dbf table, using the Loop:
Every now and then the table gets corrupted: while it is uploading the records. After uploading between 240 and 256 record's to the table the table gets corrupted and it stops and i have the validations which alerts me saying the table might be corrupted.
If there is a way to reindex and pack the table via VB to foxpro dbf, then i will do it for every trun in the loop.

My Table name is ocdata.dbf
Located at c:\dataset\ocdata.dbf

Following is the code I am using:

**************Code***************
Set oconn = New ADODB.Connection
oconn.CursorLocation = adUseClient
oconn.ConnectionString = "Provider=vfpoledb.1;
DataSource=c:\dataset\;Collating Sequence=general"
oconn.Open

sql = "Select * from ocdata where ocdata.ID = (Select max(ocdata.id) from ocdata)"
Set rsocd = New ADODB.Recordset
rsocd.Open sql, oconn, adOpenStatic, adLockOptimistic, adCmdText

rsocd.AddNew
rsocd!id = newno
If Item2 <> "" Then
rsocd!tiffile = Trim(FItem2)
End If
If s <> "" Then
rsocd!ocdata = Trim(s)
End If
rsocd!created_dt = Date
rsocd.Update
**************************************************
Thank you very much, Cetin.
Next
Reply
Map
View

Click here to load this message in the networking platform