how do we trace who update the values?

Ask a Question related to Dreamweaver AppDev, Design and Development.

  1. #1

    Default how do we trace who update the values?

    Hi..
    my DW pages require user to logon with login user server behaviors, and every
    table has coulmn called updatedby..
    so if user updating the values in dreamweaver page I able to trace them thru a
    updated by clolumn,
    so how do I do that.. to trace who's user manipulating data in my db??

    samkry Guest

  2. Similar Questions and Discussions

    1. Retrieving values from DataGrid row before update
      I have an editable datagrid and need to retrieve the values of the cells before they are changed by the user. I tried to read the text values from...
    2. Charts... how to auto update values
      I have worked with Illustrator to automate updates in chart values by using actions. I am trying to use freehand becasue it allows easier formatting...
    3. Please tell me I'm crazy!!! - Reload page does not update textbox values.
      Scenario: 1. I dynamically generate a form (using server-side code) with numerous text boxes that are populated with values from a database. ...
    4. Trace.Warn / Update Web Reference (Newbie Questions)
      Anyone out there able to offer help with this situation? thanks. jimdoen@hotmail.com (jim) wrote in message...
    5. Getting Original Values For Update
      Hi -- I am using webmatrix so whatever I try and do is determined by what I can do by hand. That said, I am trying to figure out how to get the...
  3. #2

    Default Re: how do we trace who update the values?

    When you use the Dreamweaver login behaviour it creates a Session called
    MM_Username, which you can use in a Hidden field to insert into your record
    along with the other details.
    If you would like to use the User's ID, then you can either create an
    Additional Session to pass the UserID or place a recordset on each page,
    filtered by Session MM_Username and then grab the UserID from the recordset.

    I have a tutorial on creating additional sessions =
    [url]http://www.cgw3.co.uk/tutorials/tutorial.asp?TutorialID=37&CategoryID=3[/url]

    Also I wrote a tutorial on dmxzone
    [url]http://www.dmxzone.com/showDetail.asp?TypeId=28&NewsId=7645[/url] which contains so
    help in this area.



    Originally posted by: samkry
    Hi..
    my DW pages require user to logon with login user server behaviors, and every
    table has coulmn called updatedby..
    so if user updating the values in dreamweaver page I able to trace them thru a
    updated by clolumn,
    so how do I do that.. to trace who's user manipulating data in my db??



    CarlGrint Guest

  4. #3

    Default Re: how do we trace who update the values?

    Ok.
    When user success to log on it will direct to the main page, so in my main
    page there is a link to insert pages
    so how do I insert the values together with username who logon to the pages...
    my insert page will have textfield and so far have no problem to inserting the
    values but I still cannot insert username in...
    I use hidden field and it so far I only now how to put the defualt values not
    dynamic values which is username

    sorry can't open the page since it was block by our proxy server

    samkry Guest

  5. #4

    Default Re: how do we trace who update the values?

    Couple of ways, if you simply want to use the Session, enter
    <%=Session("MM_Username")%> in the Value field, or if you have a recordset,
    select the lightning symbol in the HIdden field properities and select the
    column field you want to enter as the value.

    Originally posted by: samkry
    Ok.
    When user success to log on it will direct to the main page, so in my main
    page there is a link to insert pages
    so how do I insert the values together with username who logon to the pages...
    my insert page will have textfield and so far have no problem to inserting the
    values but I still cannot insert username in...
    I use hidden field and it so far I only now how to put the defualt values not
    dynamic values which is username

    sorry can't open the page since it was block by our proxy server



    CarlGrint Guest

  6. #5

    Default Re: how do we trace who update the values?

    Hi..
    I'm using the recordset and put the values in hidden field column but when I
    preview the page it giving me an ie error..

    below is the page

    <%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%>
    <!--#include file="Connections/FTI.asp" -->
    <%
    var Recordset1__MMColParam = "1";
    if (String(Request.QueryString("mm_username")) != "undefined" &&
    String(Request.QueryString("mm_username")) != "") {
    Recordset1__MMColParam = String(Request.QueryString("mm_username"));
    }
    %>


    still blur and sorry for the dumbness

    samkry Guest

  7. #6

    Default Re: how do we trace who update the values?

    Its not a URL variable its a Session, called MM_Username, thus your recordset
    will fail.

    Change the filter type to Session, and it should work ok, always a good idea
    to place a Show IF around the value anyway, so the errors do not occur.


    Originally posted by: samkry
    Hi..
    I'm using the recordset and put the values in hidden field column but when I
    preview the page it giving me an ie error..

    below is the page

    <%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%>
    <!--#include file="Connections/FTI.asp" -->
    <%
    var Recordset1__MMColParam = "1";
    if (String(Request.QueryString("mm_username")) != "undefined" &&
    String(Request.QueryString("mm_username")) != "") {
    Recordset1__MMColParam = String(Request.QueryString("mm_username"));
    }
    %>


    still blur and sorry for the dumbness



    CarlGrint Guest

  8. #7

    Default Re: how do we trace who update the values?

    Yep,
    it's ok now.. but when I submitted the insert form it's only inserted the
    values for the values fill in the textfield and not for values in hidden field
    again is my DW scripts

    <%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%>
    <!--#include file="Connections/FTI.asp" -->
    <%
    // *** Edit Operations: declare variables

    // set the form action variable
    var MM_editAction = Request.ServerVariables("SCRIPT_NAME");
    if (Request.QueryString) {
    MM_editAction += "?" + Request.QueryString;
    }

    // boolean to abort record edit
    var MM_abortEdit = false;

    // query string to execute
    var MM_editQuery = "";
    %>
    <%
    // *** Insert Record: set variables

    if (String(Request("MM_insert")) == "form1") {

    var MM_editConnection = MM_FTI_STRING;
    var MM_editTable = "dbo.logesn";
    var MM_editRedirectUrl = "";
    var MM_fieldsStr = "textfield|value|hiddenField|value";
    var MM_columnsStr = "hexesn|',none,''|updatedby|',none,''";

    // create the MM_fields and MM_columns arrays
    var MM_fields = MM_fieldsStr.split("|");
    var MM_columns = MM_columnsStr.split("|");

    // set the form values
    for (var i=0; i+1 < MM_fields.length; i+=2) {
    MM_fields[i+1] = String(Request.Form(MM_fields));
    }

    // append the query string to the redirect URL
    if (MM_editRedirectUrl && Request.QueryString && Request.QueryString.Count >
    0) {
    MM_editRedirectUrl += ((MM_editRedirectUrl.indexOf('?') == -1)?"?":"&") +
    Request.QueryString;
    }
    }
    %>
    <%
    // *** Insert Record: construct a sql insert statement and execute it

    if (String(Request("MM_insert")) != "undefined") {

    // create the sql insert statement
    var MM_tableValues = "", MM_dbValues = "";
    for (var i=0; i+1 < MM_fields.length; i+=2) {
    var formVal = MM_fields[i+1];
    var MM_typesArray = MM_columns[i+1].split(",");
    var delim = (MM_typesArray[0] != "none") ? MM_typesArray[0] : "";
    var altVal = (MM_typesArray[1] != "none") ? MM_typesArray[1] : "";
    var emptyVal = (MM_typesArray[2] != "none") ? MM_typesArray[2] : "";
    if (formVal == "" || formVal == "undefined") {
    formVal = emptyVal;
    } else {
    if (altVal != "") {
    formVal = altVal;
    } else if (delim == "'") { // escape quotes
    formVal = "'" + formVal.replace(/'/g,"''") + "'";
    } else {
    formVal = delim + formVal + delim;
    }
    }
    MM_tableValues += ((i != 0) ? "," : "") + MM_columns;
    MM_dbValues += ((i != 0) ? "," : "") + formVal;
    }
    MM_editQuery = "insert into " + MM_editTable + " (" + MM_tableValues + ")
    values (" + MM_dbValues + ")";

    if (!MM_abortEdit) {
    // execute the insert
    var MM_editCmd = Server.CreateObject('ADODB.Command');
    MM_editCmd.ActiveConnection = MM_editConnection;
    MM_editCmd.CommandText = MM_editQuery;
    MM_editCmd.Execute();
    MM_editCmd.ActiveConnection.Close();

    if (MM_editRedirectUrl) {
    Response.Redirect(MM_editRedirectUrl);
    }
    }

    }
    %>
    <%
    var Recordset1__MMColParam = "1";
    if (String(Session("mm_username")) != "undefined" &&
    String(Session("mm_username")) != "") {
    Recordset1__MMColParam = String(Session("mm_username"));
    }
    %>

    <%
    var Recordset1 = Server.CreateObject("ADODB.Recordset");
    Recordset1.ActiveConnection = MM_FTI_STRING;
    Recordset1.Source = "SELECT * FROM dbo.Employee WHERE Firstname = '"+
    Recordset1__MMColParam.replace(/'/g, "''") + "'";
    Recordset1.CursorType = 0;
    Recordset1.CursorLocation = 2;
    Recordset1.LockType = 1;
    Recordset1.Open();
    var Recordset1_numRows = 0;
    %>

    samkry Guest

  9. #8

    Default Re: how do we trace who update the values?

    Yes..
    The page now successfull inserted and the values for updated by columns also inserted

    thanks..
    samkry Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139