Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to reindex and pack from executable
Message
De
09/09/2004 10:36:14
 
 
À
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
How to reindex and pack from executable
Divers
Thread ID:
00940642
Message ID:
00940642
Vues:
120
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
Fil
Voir

Click here to load this message in the networking platform