General information
Title:
How to reindex and pack from executable
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only