Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Buffering data
Message
 
À
25/03/2006 10:12:43
Mk Sharma
Shrishti Solutions
Mumbai, Inde
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01107621
Message ID:
01107665
Vues:
24
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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform