Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Find out corrupted table in dbc
Message
 
 
À
30/08/2004 09:26:25
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00936469
Message ID:
00938363
Vues:
18
Tariq,

Here is an amended version of your original program. The program now attempts to open each table in you database, and produces an error message if there is a problem with one.

I'm sure you could easily amend this to make this into a sub-routine to check any database file you specify.
CLOSE ALL
CLOSE DATABASES
OPEN DATABASE D:\SYSTEM\TABLES\ACCOUNT.DBC EXCLUSIVE

= adbobjects(laTableArray, "TABLE") && Put table names into an array

for i=1 to alen(latablearray) && loop through each table in the array
 mtablename=latablearray(i)   && pick up table name from array
 =opentable(mtablename) && attempt to open table
next x

PROCEDURE OPENTABLE
PARAMETERS M.TABLE

ON ERROR DO MYERROR WITH ERROR(),MESSAGE(),MESSAGE(1),PROGRAM(),LINENO()
USE (M.TABLE) IN 0
ON ERROR
ENDPROC

PROCEDURE MYERROR
PARAMETERS M.ERROR,M.MESSAGE,M.MESSAGE1,M.PROGRAM,M.LINENO

CLEAR
? 'Error number: ' + LTRIM(STR(m.error))
? 'Error message: ' + M.MESSAGE
? 'Line of code with error: ' + M.MESSAGE1
? 'Line number of error: ' + LTRIM(STR(m.lineno))
? 'Program with error: ' + m.program
WAIT
RETURN
HTH
Rob
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform