Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Findout corrupted dbf
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01172800
Message ID:
01173069
Views:
14
>Dear Experts
>
>workdir=getdir()
>
>data1.dbc and all dbf's are located in workdir,
>How to findout corrupted dbf's.
>The name of all corrupted dbf's must store in a c:\corrupt.txt.
>
>Please help

Here's a simple way...
lcBadFiles = ""
on error llBadFile = .t.
lnDBFs = adir( laDBFs, "*.dbf" )
for lnI = 1 to lnDBFs
  llBadFile = .f.
  use ( laDBFs[ lnI, 1 ] )
  if llBadFile
    lcBadFiles = lcBadFiles + laDbfs[ lnI, 1] + chr(13)+chr(10)
  endif 

endfor 

strtofile( lcBadFiles, "c:\corrupt.txt" )
on error
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform