General information
Title:
Error Message Alias RegTemp Not Found
I am getting an error
"Alias REGTEMP Not Found"
that to only in EXE file and that to if I run the same option say 5 to 6 times then only I get this error.
My form is having 1 text box 1 grid (Name : grdtempReg recordSource = tempreg) and 2 buttons save and exit.
The following code in Load event of the form.
public flname
flname=""
flname= sys(3)+".dbf" && Temporory File Name
fl_nm_2 = sys(3)+ ".dbf"
on error
if not used('register')
sele 0
use register order register
else
sele register
set order to tag register
endif
sele register
create table &flname ;
( reg_flg c(1),;
regn_no n(7),;
regn_date d(8),;
wait_no n(6),;
name c(30),;
flg_desc c(20),;
allot_dt d(8),;
deleted c(1),;
conn_mat c(1),;
cons_no c(6)) && dt 14 Jun 2001
use
if used("REGTEMP")
sele regtemp
use
endi
sele 0
use &flname alia regtemp excl
* -----
if used("regtemp")
wait wind "used 1"
else
wait wind "not used 1"
endif
* ------
* ----
sele 0
create table &fl_nm_2 ;
( reg_flg c(1),;
regn_no n(7),;
regn_date d(8),;
wait_no n(6),;
name c(30),;
flg_desc c(20),;
allot_dt d(8),;
deleted c(1),;
conn_mat c(1),;
cons_no c(6)) && dt 14/06/2001
use
if used("RGTMP")
sele rgtmp
use
endi
sele 0
use &fl_nm_2 alia rgtmp excl
* -----
if used("regtemp")
wait wind "used 1.1"
else
wait wind "not used 1.1"
sele 0
use &flname alia regtemp excl
if used("regtemp")
wait wind "used 1.2"
else
wait wind "Not used 1.2"
endif
endif
* ------
sele 0
create dbf tempreg ;
( reg_flg c(1),;
regn_no n(7),;
regn_date d(8),;
wait_no n(6),;
name c(30),;
flg_desc c(20),;
allot_dt d(8),;
deleted c(1),;
conn_mat c(1),;
cons_no c(6)) && dt 14 Jun 2001
if not used("tempreg")
sele 0
use tempreg
else
sele tempreg
endif
* -----
if used("regtemp")
wait wind "used 2"
else
wait wind "not used 2"
sele 0
use &flname alia regtemp excl
if used("regtemp")
wait wind "used 2.1"
else
wait wind "Not used 2.1"
endif
endif
* ------
In Exit I havce written
thisform.unload
thisform.release
In Unload
close data
clos inde
if file(flname)
Delete file &flname
wait wind "Deleted"
else
wait wind "Not Deleted"
endi
In Realse
if file(flname)
Delete file &flname
endi
and in INit
thisform.grdtempreg.recordsource="regtemp"
thisform.grdtempreg.recordsourcetype=1
thisform.grdtempreg.column1.controlsource="regtemp->reg_flg"
thisform.grdtempreg.column2.controlsource="regtemp->flg_desc"
thisform.grdtempreg.column3.controlsource="regtemp->regn_no"
thisform.grdtempreg.column4.controlsource="regtemp->Regn_date"
thisform.grdtempreg.column5.controlsource="regtemp->Wait_No"
thisform.grdtempreg.column6.controlsource="regtemp->Name"
Is it because of SYS(3) Function or something else.
Form is having wait wind because I wanted to debug it.
It gives "Not used 1.1" and then "file in use error message"
temp File is also not getting deleted. It accumulates.
Pl. help.
Thanks in advance.
Ashish Patel
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only