Information générale
Titre:
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.
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement