Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Zap DBF if no error occurs
Message
From
20/05/2005 09:21:36
 
 
To
20/05/2005 07:21:06
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 6
OS:
Windows '98
Network:
Windows 98
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01016146
Message ID:
01016170
Views:
8
>I want to zap following three dbf's, if no error occurs.
>I mean if database not found or any dbf is corrupt then EXIT.
>In other case, if database found and dbf's are OK then given dbf's should ZAP.
>
>CLOSE ALL
>CLOSE DATABASES ALL
>OPEN DATABASE cFolder2+'\TABLES\ACCOUNT.DBC' EXCLUSIVE
>USE vouchers
>ZAP
>USE VOU_SUM
>ZAP
>USE VOU_NO
>ZAP
>
Local lError
Try
  OPEN DATABASE cFolder2+'\TABLES\ACCOUNT.DBC'
  USE vouchers EXCLUSIVE
  ZAP
  USE VOU_SUM EXCLUSIVE
  ZAP
  USE VOU_NO EXCLUSIVE
  ZAP
Catch to oErr
  lError = .T.
  * you could use oErr exception object information to see what happenned.
Endtry

If lError
  MessageBox("Error erasing data")
  Return .F.
Endif
Note: You do not need to open the DBC Exclusive, just the DBFs.


Alex Feldstein, MCP, Microsoft MVP
VFP Tips: English - Spanish
Website - Blog - Photo Gallery


"Once again, we come to the Holiday Season, a deeply religious time that each of us observes, in his own way, by going to the mall of his choice." -- Dave Barry
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform