When you use Private data session you must be sure the tables are NOT opened Exclusive.
Also it is a good idea to check for errors in that function and return if you succeed to open the file, i.e.
FUNCTION UseFile(filename)
LOCAL lbReVtal
m.lbReVtal = .t.
TRY
IF NOT USED(filename)
USE (filename) SHARED IN 0
ENDIF
SELECT (filename)
SET FILTER TO
SET ORDER TO
SET RELATION TO
CATCH
m.lbReVtal = .f.
ENDTRY
RETURN m.lbReVtal
This is of course very generic error handling, you could extend it.
>i am runing this software on single machine.
>i am using a procedure file to use my dbf files like below :
>
>procedure usefile
>****
>para filename
>if !used(filename)
> sele 0
> use (filename) excl
>endif
>sele filename
>set filt to
>set order to
>set rela to
>******
>
>some files i used in my main.prg
>like :
>=usefile("customer")
>
>now i changed my form datasession to private and using the command to
>open my dbf files in load event of form
>like :
>=usefile("customer")
>
>error "file is in use"
>
>please help me
>
>warm regards,
>mk.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.