Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Displaying multiple records in textarea 1

Status
Not open for further replies.

rjn2001

Programmer
Dec 29, 2004
172
GB
Hi, I am currently using this to display the recordset from my DB, it works fine. My issue is this:

I am wanting the results from the DB to be displayed in a text field, so they can be updated, (obviously this will include the relevant update statement etc), but I am unsure as to how to get this type of formatting into the page. The code below selects all of the data that is relevant to the userid from the database, each user can have any number of records in the table, from 1 to 1000, so each varying number of records is displyed.

Can anyone assist?

Code:
<%
set conn = Server.CreateObject("ADODB.Connection")
conn.Provider = "Microsoft.Jet.OLEDB.4.0"
conn.Open "D:/Websites/richard/admin/db/users.mdb"

strSQL = "Select * From tblQual WHERE UserID ='" & strUsername & "'"
Set rsCheckUser = conn.Execute(strSQL)

If NOT rsCheckUser.EOF Then
  While NOT rsCheckUser.EOF
    strUserName = rsCheckUser("UserID")    

    If strUserName <> strOldUserName Then
      Response.Write "<tr><td colspan='2'><h2>" & strUserName & "</h2></td></tr>" & vbcrlf
    End If

    Response.Write "<tr><td><p>" & rsCheckUser("AchDte") & "</p></td><td><p>" & rsCheckUser("AchType") & "</p></td><td><p>" & rsCheckUser("AchTitle") & "</p></td><td><p>" & rsCheckUser("AchGrade") & "</p></td><td><p>" & rsCheckUser("InstitutionName") & "</p></td></tr>"
    strOldUserName = strUserName
    rsCheckUser.MoveNext
  Wend
Else
  Response.Write "<tr><td colspan='2'><p>No records found</p></td></tr>" & vbcrlf
End If

Set rsCheckUser = Nothing

conn.Close
Set conn = Nothing
%>

Thanks in advance

Richard Noon
 
are you just wanting

Code:
<input id="XXX" name="XXX" value="<%=rsCheckUser("XXX")%>" />
or am i missing the point :p?
 
depends how you are doing it. If the whole page is written dynamically then you want somthing like this

Code:
response.write("<form id='xxx' name='xxx' method='post' action='xxx.asp'.>")
response.write("<input id='XXX' name='XXX' value='"&rsCheckUser("XXX")&"' />")
response.write("</form>")

so to match in to your code

Code:
    Response.Write "<tr><td><p><input id='AchDte' name='AchDte' value='" & rsCheckUser("AchType") & "'></p></td></tr>"
 
Code:
Response.Write "<tr>"&vbcrlf&"    <td><p><input id='AchDte' name='AchDte' value='" & rsCheckUser("XXX") & "'></p></td>"&vbcrlf&"</tr>"&vbcrlf
thats how i would do it. Thanks for the stat :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top