I am having a problem with my program with regards to opening tables. I have a simple form that allows users to select their username and when they click on the button it calls another program. In addition it stores the license username, domain username, date and time they logged in and to flag that they are in the system into a table called userlog. Once the calling has finished it then locates the user in the userlog table and puts the date and time when they logged out of the system in the userlog table.
The problem I am having is opening and closing the tables for multiple users. I keep getting 'cannot access the selected table'.
Can anybody help me please Im going round in circles. All I want to do is allow for any user to open the tables at anytime!!
Here is my code:
LOCAL lcusername, lcuserstate
thisform.WindowState = 1
lcusername = ALLTRIM(READINI( "PREFS", "LASTUSER", "P:\QUESTPDM.INI"))
lcusertate = ''
= WRITEINI( "PREFS", "LASTUSER", thisform.combo1.displayvalue, "P:\QUESTPDM.INI")
USE "USERLOG"
INSERT INTO 'userlog' (pdmuserid, domuserid, datetimei, insystem) VALUES (thisform.combo1.displayvalue, SYS(0), DATETIME(), 'in')
! U:\questpdm\questpdm.exe
USE userlog
SET ORDER TO LOCATE
SEEK 'lcusername'+'In'
REPLACE UserLog.DateTimeO WITH DATETIME(), UserLog.insystem WITH 'Out'
CLEAR EVENTS
QUIT
Should I be checking if the table is open or not?
How can I access the table if other users are accessing it?
Many Thanks
Neil Lewis
IT R&D Manager
Velmore Ltd