bronx bomber /update statement

Results 1 to 2 of 2

Thread: bronx bomber /update statement

  1. #1
    Join Date
    Dec 1969

    Default bronx bomber /update statement

    thanks gives me no errors however it is not updating my database and I do not know why. <BR>this is what I am doing if you can remember from friday <BR><BR>have a loginpage ,if authenticated ---takes you to secure(information.asp)page. <BR>Now the information.asp page has a log off button where user logs off when finished with the site. this log off button fires a script that abandons users session and updates a database in access <BR><BR><BR>This update statement is the one you just corrected that <BR><BR>SQLstmt = "update Admin set Registeroff = #" & time() & "# where Access_UserName = &#039;" & userid & "&#039; and Access_ID = " & usermid <BR><BR>updates the database with the time user has log off.The time and username of log in is captured when user logs In via the login page.This infor is captured in a log table captures who has log in ,time and date . <BR>In this login.asp where I do the initial insert into the admin database in access I also have variables set up to capture the Access_Username and Access_ID from my mdb.The Access_ID is an autonumber field. <BR> UserN = RS("Access_UserName") <BR> Session("UserID") = UserN <BR> UserD = RS("Access_ID") <BR> Session("ID") = UserD <BR><BR>I had created the Access_ID field in the Mdb because when the same user eg joe loggsin so many times each login session is inserted into the database in which case the same username appears many times.there when I say update the database where Access_Username = userid it updates all the records that have joes name with the same log off time .all exsisting log off time are replaced with the most resent log off time. <BR>I therfore needed a unique identifier to narrow the record that I want , so that its nolonger just by the username but also the Access_Id. <BR>In which case only that particular record will be updated with the log off time and not all joe&#039;s <BR><BR>**Explaning further --- i created this field Access_Id in my db so so that each time joe logins in it creates a new number Access_Id for joe. <BR>if he logs in again 5minutes later another record will be inserted as a new record with a new auto number (Access_ID). <BR>thats why after the insert frm the log in page where name, date and time is inserted .The update statement just updates log off time of that record where the username and id is he same . <BR><BR>However it does not update the log off time now??? <BR>how can I correct this <BR>hope I am clear enough <BR>

  2. #2
    Join Date
    Dec 1969

    Default *** -

    Dont repost. Its bad bad bad ettiquette. I&#039;ll find you, dont worry.<BR><BR>If its not updating, then criteria must not be met. Have you tried running the query in Access, filling in values, and seeing if it works?

Posting Permissions

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