Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 25th, 2004, 10:13 AM
Registered User
 
Join Date: Aug 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Multiple records to be put in text boxes

I have multiple records in my SQL database and the number of records changes constantly.
I would like to let this records appear in textboxes so that I can edit them via the GUI.
Does any one have any idea how about going to do it?
Thanks.

Mou
 
Old August 25th, 2004, 08:52 PM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 363
Thanks: 0
Thanked 1 Time in 1 Post
Default

Yeah,


   dim conn,rs,strQry,strHTML
   set conn=server.createObject("ADODB.connection")
   conn.connectionstring="..."
   set rs=server.createObject("ADODB.recordset")
   strQry="select fld1,fld2,fld3 from table..."
   rs.open strQry,conn

   strHTML="<form name='frm1' action='page.asp' method='post'><table align='center' cellpadding='3' cellspacing='0'>"
   while not rs.eof
   strForm=strForm & "<tr><td><input type='checkbox' name='chk1' value='Y'></td><td><input type='text' name='txtFld1' value='" & rs("fld1") & "'></td><td><input type='text' name='txtFld2' value='" & rs("fld2") & "'></td></tr>"
       rs.movenext
   wend
rs.close

strForm=strForm & "<tr><td colspan='3' align='center'><input type='button' value='Edit' onclick='chkData()'></td></tr></table></form>"

' then do your coding



 
Old August 25th, 2004, 08:52 PM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 363
Thanks: 0
Thanked 1 Time in 1 Post
Default

sorry!

  replce strForm with strHTML



 
Old September 3rd, 2004, 06:33 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

I would never suggest this way of editing rows. How many records would you edit at a time? Does that not complicate things? Considering usability and code management perspectives, this method of editing is not advisable.

I would suggest listing of values on a page in a row/column format and allow the user to edit one row at a time. That is the better and most commonly used method of editing rows using web applications.

Cheers!

_________________________
- Vijay G
Strive for Perfection





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to put a value into another form's text box? alastair Access VBA 3 December 20th, 2006 06:19 PM
Auto-Filling a Text box based on Multiple Boxes zuldan23 Access VBA 1 May 5th, 2006 10:17 AM
drag and drop to multiple text boxes gbuller VB.NET 5 September 6th, 2004 09:55 PM
Extract text from text file & put in dropdown box tsukey Beginning PHP 5 July 20th, 2004 09:49 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.