Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2003
    Posts
    1

    Unanswered: Update master/detail pages (urgent)

    Hi.

    I have Detail-Master relationship, but also i want to update the data in the detail.asp.

    Inorder to display a detail.asp, i used a UseriD to store the request.form(ID)from the master.asp. Then in that UserID, i used to retrieve the detail info for that ID.

    But i want to update the retrieved data in the datail.asp ?

    I have added "edit" link in the detail.asp and again used the UserID , so that i will again retrieve detail info in input boxes where i can make changes to it and update.
    But my problem is " the edit link can not capture the USERID".

    IF i put the mouse on the link, i can only see "update_form.asp?ID = "

    How can i capture the userID in teh detail.asp?
    How can be updated detail.asp in Master-detail relationship ??

    This is the code.


    <html>
    <head>
    <title>detail</title>
    </head>
    <body>
    <BR>
    <%
    UserID=Request.QueryString("ID")
    dim oRSmt
    set oRSmt=server.createobject("ADODB.recordset")
    sqlText="Select * from Student WHERE ID="& UserID & ""
    oRSmt.Open sqlText, "DSN=XYSN"
    %>
    <!-- Building The Table Header rows -->
    <center> <br><br><br><br><br>
    <TABLE border=1 cellspacing=1>

    <TR>
    <TD COLSPAN=6 ALIGN=CENTER> The Details </TD>
    </TR>
    <TR>
    <TH BGCOLOR=navy><FONT COLOR=white> Student ID</FONT></TH>
    <TH BGCOLOR=navy><FONT COLOR=white> First Name </FONT></TH>
    <TH BGCOLOR=navy><FONT COLOR=white> Last Name </FONT></TH>
    <TH BGCOLOR=navy><FONT COLOR=white> DOB </FONT></TH>

    </TR>

    <%


    Do while NOT oRSmt.EOF

    %>
    <!-- Build a row of data in the table -->

    <TR>
    <TD><%=oRSmt("ID")%></TD>
    <TD><%=oRSmt("FirstName")%></TD>
    <TD><%=oRSmt("LastName")%></TD>
    <TD><%=oRSmt("DOB")%></TD>


    </TR>
    </center>
    <%

    oRSmt.MoveNext
    Loop
    oRSmt.Close
    Set oRSmt = Nothing

    %>

    </TABLE>
    <center>
    <p><a href="update_form.asp?ID="oRSmt("& UserID &")>edit</a></p>
    </center>

    </body>
    </html>

    thanks in advance



    Please help

  2. #2
    Join Date
    Oct 2003
    Location
    Pune
    Posts
    59
    What i can see in a code is U have closed the recordset object and after words u r trying to retrive the filed value in HREF
    Cyrus
    Finding ways for solution

Posting Permissions

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