Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: Search and Update Form


Message #1 by oneil_brown@h... on Tue, 30 Oct 2001 20:42:41
How would I create an html page  that will take the value of two fields, 

search a db and bring back the corresponding record to edit in an html 

page using asp.  I have been driving myself crazy trying to use 

the "Beginning ASP Database" book.  Please help.
Message #2 by "Michael Seils" <mseils@s...> on Wed, 31 Oct 2001 03:10:35
That is a good question. Unfortuanately, I am not going to write all your 

code for you. If you have a specific question about your code, post that 

part of your code and maybe someone can help you.

Thanks.





> How would I create an html page  that will take the value of two fields, 

> search a db and bring back the corresponding record to edit in an html 

> page using asp.  I have been driving myself crazy trying to use 

> the "Beginning ASP Database" book.  Please help.
Message #3 by gbrown@c... on Wed, 31 Oct 2001 12:34:46
> How would I create an html page  that will take the value of two fields, 

> search a db and bring back the corresponding record to edit in an html 

> page using asp.  I have been driving myself crazy trying to use 

> the "Beginning ASP Database" book.  Please help.



Hi



Basic idea would be to create an ASP file like this:-



select case request("option_required")

case "Find"

' code to do the find and show the edit window

' basically does a select * from table where value1=request("formfield")

' into a recordset then does a simple html form.

case "Save"

' Code to do the save which would consist of SQL Update statements

case else

' code to show your find window

end select



The third choice has a hidden field for option value of find.

The second choice has option value of Save

The edit window has input tags then have a value of "<%=objrs

("field_name")%>"



You need to look into connections/connection strings, recordsets and 

command objects. The rest is just plain html.



There are tons of examples both in the wrox books and on the web. Suggest 

if you are having a particular problem then post exactly what it is.



Can't write the code for you but hope that helps.



Regards

Graham


  Return to Index