Results 1 to 7 of 7
  1. #1
    2 Star Lounger
    Join Date
    Oct 2001
    Location
    Suffolk, England
    Posts
    134
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Remembering Variables (2000)

    I have a database that requires the User to log in - the user code is stored as a public variable and is then used to monitor any activities that the user carries out. Occasionally, with no particular pattern that I can fathom, the computer 'forgets' the user code - even though I also have a back up variable - it seems to forget that too. The database has several (upto 7) concurrent users and the main tables are SQL. The usercode variable is not declared anywhere other than in a public module. Does anyone know why this happens - or even better, a cure?
    Thanks

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Remembering Variables (2000)

    I don't know the cause, but you could store the usercode in a table. That should be more permanent than a variable.

  3. #3
    2 Star Lounger
    Join Date
    Oct 2001
    Location
    Suffolk, England
    Posts
    134
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Remembering Variables (2000)

    Thanks for that , but how would it work given that there is more than one user code in use at a given time?

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Remembering Variables (2000)

    I always use a split database design - one central backend with the data tables, and a local frontend for each user with queries, forms, etc. Personal settings are kept in a table in the local frontend.

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Remembering Variables (2000)

    BTW if you use user-level security, you can use CurrentUser - this will return the name under which the user logged into the database (in an unsecured database, this is Admin for all users, so there it's useless). You can also retrieve the user's Windows login name or the computer name - see the functions in <post:=404,436>post 404,436</post:>.

  6. #6
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Remembering Variables (2000)

    One thing that will cause it to forget the values held in variables is unhandled run-time errors.

    All code should include error handling.
    Attached Images Attached Images
    Regards
    John



  7. #7
    2 Star Lounger
    Join Date
    Oct 2001
    Location
    Suffolk, England
    Posts
    134
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Remembering Variables (2000)

    Thanks, I think retrieving the user login name will work.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •