Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
No. of people using a DBF
Message
 
To
30/03/2005 15:07:57
General information
Forum:
Visual FoxPro
Category:
FoxPro 2.x
Environment versions
Visual FoxPro:
FoxPro Dos
Miscellaneous
Thread ID:
00999886
Message ID:
01000216
Views:
43
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
___________________________________________
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform