Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Buffering data
Message
 
To
25/03/2006 10:12:43
Mk Sharma
Shrishti Solutions
Mumbai, India
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01107621
Message ID:
01107665
Views:
22
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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform