How to I do this???????

Results 1 to 4 of 4

Thread: How to I do this???????

  1. #1
    AJS Guest

    Default How to I do this???????

    Im creating an asset register as part of my Final Year Project for college. I can display all assets in the database but would like for the user to be able to modify an asset by clicking on it&#039;s ID. I already have an update function working but the user has to select the ID of the asset he wants to modify from a drop down list. This isn&#039;t very practicle. Does anybody know how the user would click the ID number from the list of assets page theryby opening a new window with the record details to be modified. <BR><BR>Bear in mind, i&#039;m fairly new to all of this. <BR><BR>Thanks <BR>

  2. #2
    Join Date
    Dec 1969

    Default Drinking beer in college

    Well<BR><BR>young fellow.<BR><BR>In your list (in a table possibly)<BR><BR>this is what I would do for simplicity sake<BR>build a form around each record<BR>so <BR>response.write "&#060;form method=post action=editassetform.asp&#062;"<BR>response.write "&#060;input type=hidden name=assetid value="&rs("id")&"&#062;"<BR>... some other stuff.<BR>response.write "&#060;/form&#062;"<BR><BR>then just do your recordset loop or whatever, and print a new small form off each time. make the a submit button at the end of each record <BR>or <BR>response.write "&#060;a href=javascript:form.submit();&#062;" & id &"&#060;/a&#062;"<BR><BR>i left out some stuff, but you should get the idea.<BR><BR>so as you loop through your record set

  3. #3
    Fazio82_7 Guest

    Default maybe...

    Hey! Had the same problem a few weeks ago...<BR>came up with this<BR><BR>first, start a loop that displays all records from the database...<BR><BR>while not rs.eof &#039;rs = recordset object; eof = "end of file" <BR> <BR>then, just add html links that are dynamic to each individual record in the recordset.. (really pretty easy)<BR><BR>while not rs.eof<BR> response.write "&#060;a href=""RecordUpdate.asp?ID=" & _<BR> rs("NAME_OF_ID_FIELD_HERE") & """&#062;ID&#060;/a&#062;"<BR>wend<BR><BR>Here, you are just passing a query string in the URL. The query string will contain the ID # from your database.<BR>When you create your RecordUpdate.asp page, just have it recieve the query string like so:<BR> intID = request("ID")<BR>then, pull the requested record from the database with the intID variable and display your data!!<BR><BR>I hope that this is what you are looking for...if having me at<BR><BR>good luck!<BR><BR>Fazio

  4. #4
    Fazio82_7 Guest

    Default syntax correction

    need to make a is the final product:<BR><BR>while not rs.eof<BR> response.write "&#060;a href=""RecordUpdate.asp?id=" & _<BR> rs("NAME_OF_ID_FIELD_HERE") & """&#062;ID&#060;/a&#062;"<BR> rs.movenext &#060;--forgot this (very important :)<BR>wend<BR><BR><BR>good luck!

Posting Permissions

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