Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
No. of people using a DBF
Message
 
À
30/03/2005 15:07:57
Information générale
Forum:
Visual FoxPro
Catégorie:
FoxPro 2.x
Versions des environnements
Visual FoxPro:
FoxPro Dos
Divers
Thread ID:
00999886
Message ID:
01000216
Vues:
40
Hi Craig

>The user still doesn't need to login. Capture the workstation name and store it in a table. That's can be invisible to the user.

I have tried something like the following but have a problem is that at times the 2nd-3rd user is allowed to FCREATE() the file already assigned to the prev user ie. 1st-2nd resp. How to avoid allowing to use the same filename. I have tried it on the same machine seperate DOS boxes.

Please advise.
        *** seed and ignore the first returned value
        m.zfilename = intrandrange(00000000, 99999999, 87654321)


        FOR m.zusercount = 1 TO m._vsomaxuser
                *** get an integer for use as a filename
                m.zfilename = ALLTRIM(STR(intrandrange(00000000, 99999999))) + ".acu"
                m.zfh       = FCREATE(m.zfilename)
wait window "1" + str(m.zusercount) + " " + m.zfilename + str(m.zfh)

                IF m.zfh > -1
                        *** Person is no longer using the application and did not
                        *** log out properly, now that we have the open handle keep it
                        *** open and exit
                        EXIT
                ENDIF
        ENDFOR


wait window "2" + str(m.zusercount) + " " + m.zfilename + str(m.zfh)
        IF (!m.nomore) AND (m._vsolan AND m.zusercount > m._vsomaxuser AND m._vsomaxusers > 0)
                * WARNING !!! Maximum
                * users Allowed; Close Idle Instances of this Applcation before
                * ReStarting; If a Node was Hanged or ReBooted Please ReStart ALL
                * Instances again

                m.nomore = .T.
        ENDIF
Regards
Bhavbhuti
___________________________________________
Softwares for Indian Businesses at:
http://venussoftop.tripod.com
___________________________________________
venussoftop@gmail.com
___________________________________________
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform