This topic is locked

Read field value...

12/5/2009 3:25:29 PM
ASPRunnerPro General questions
S
stalbone author

Hi
I would have a problem... <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=13280&image=1&table=forumtopics' class='bbc_emoticon' alt=':(' />
Sample...
I have 2 table.

  1. Data
  2. DataMod
    In Data i have 3 field: id, Name, Year

    In DataMod i have 3 field: idDataMod, idData,UserName
    When I modify (edit) a record in the first table (Data), I would want to write in DataMod the name (username) of whom has performed the login

    and the ID of the record (table Data) that has been modified.

    As it is possible to read the value of ID?
    In Table Events -> After record updated i have write this code:
    USERNAME = UCase(Session("UserID"))

    IdDati = values("id") ID is id from DATA table... !! How read the value of the field from the table DATA ???
    strSQLIns = "insert into DATAMOD (Mod_id, Mod_User) values ('" & IdDati & "', '" & UserName & "')"

    dbConnection.Execute strSQLIns
    Many tnx !
    Stefano

J
Jane 12/7/2009

Stefano,
key values are in the keys array:

USERNAME = UCase(Session("UserID"))

IdDati = keys("id")
strSQLIns = "insert into DATAMOD (idData,UserName) values ('" & IdDati & "', '" & USERNAME & "')"

dbConnection.Execute strSQLIns