Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
File is in use error
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
File is in use error
Miscellaneous
Thread ID:
00019868
Message ID:
00019868
Views:
66
The first time I run the following code everything works as intended. But the next time I fun it, I get a "File is in use" error when the USE "TPD_Payments" command is issued. Any ideas? How do I find out what files are in use? I thought "Use" by itself would close the table, but when I tried it from the command line, issuing "Use 'TPD_payments'" still gives me the error.

p_claimno = VAL(thisform.txtClaimNumber.Value)
pcTest = thisform.txtClaimNumber.Value
USE "TPD_Payments"
SET EXACT OFF
SET ORDER TO 1
SEEK p_claimno
IF FOUND( )
SELECT ALL hours_worked, hourly_rate, earned,;
wage_loss_amt, wage_loss_pct, payment_amount,;
date_through, ss_number, claimant_name,;
date_of_accident, a.weekly_ttd_rt, a.weekly_wage;
FROM wc!tpd_payments a, wc!claimant_record b;
WHERE (a.claim_number = b.Claim_number) and;
(a.claim_number = p_claimno) and;
(!EMPTY(a.date_through));
INTO CURSOR wc13b1
SELECT ALL hours_worked, hourly_rate, earned,;
wage_loss_amt, wage_loss_pct, payment_amount,;
date_through, ss_number, claimant_name,;
date_of_accident, a.weekly_ttd_rt, a.weekly_wage;
FROM wc!tpd_pay_history a, wc!claimant_record b;
WHERE (a.claim_number = b.Claim_number) and;
(a.claim_number = p_claimno) and;
(!EMPTY(a.date_through));
INTO CURSOR wc13b2
SELECT wc13b1.* ;
FROM wc13b1;
UNION ALL;
SELECT wc13b2.*;
FROM wc13b2;
INTO CURSOR wc13b
RELEASE ThisForm
REPORT FORM wc13b PREVIEW
ELSE
cMessageTitle = 'Claim Number Not Found'
cMessageText = 'Record not found. Would you like to try again?'
nDialogType = 4 + 32 + 256
* 4 = Yes and No buttons
* 32 = Question mark icon
* 256 = Second button is default
nAnswer = MESSAGEBOX(cMessageText, nDialogType, cMessageTitle)
DO CASE
CASE nAnswer = 6
* ThisForm.txtClaimNumber.Format = "K"
ThisForm.txtClaimNumber.SetFocus
CASE nAnswer = 7
RELEASE ThisForm
ENDCASE
ENDIF
Next
Reply
Map
View

Click here to load this message in the networking platform