www.webdeveloper.com
Results 1 to 4 of 4

Thread: Not displaying all data

  1. #1
    Join Date
    Aug 2004
    Posts
    82

    Not displaying all data

    I'm trying to fill a text box with information from a database. The info is coming over but it is not displaying all of it. It only displays up to the first space. If I delete the spaces in between the words in the database it works other than the words are all run together. When I look at the HTML the data is there but not totally displayed.

    Here is my code:
    Code:
    urab=request.querystring("id")
    strSQL="SELECT * FROM empInfo WHERE Id= " & curab
    objRS.Open strSQL, dbConn
    response.write "Edit an employee name and/or cell phone number" & "</FONT>"
    response.write "<BR><BR><B>Employee Name:&nbsp;&nbsp;</B><INPUT TYPE=text SIZE=100" & " " & "NAME=txtName" & " " & "VALUE=" & objRS("empName") & ">" 
    response.write "<BR><BR><B>Cell Phone Number:&nbsp;&nbsp;</B><INPUT TYPE=text" & " " & "NAME=txtcPhone" & " " & "VALUE=" & objRS("empcPhone") & ">"

    Here is the HTML as a result of the code above.
    Code:
    <INPUT TYPE=text SIZE=100 NAME=txtName VALUE=Alan Ekstein(Karen)><BR><BR><B>Cell Phone Number:&nbsp;&nbsp;</B><INPUT TYPE=text NAME=txtcPhone VALUE=(518) 464-4080>
    Any ideas?

  2. #2
    Join Date
    Feb 2003
    Posts
    2,745
    You need to iterate through the recordset -- else you just get the first record.

    Code:
    urab=request.querystring("id")
    strSQL="SELECT * FROM empInfo WHERE Id= " & curab
    objRS.Open strSQL, dbConn
    
    While Not objRS.Eof
       response.write "Edit an employee name and/or cell phone number" & "</FONT>"
       response.write "<BR><BR><B>Employee Name:  </B><INPUT TYPE=text SIZE=100" & " " & "NAME=txtName" & " " & "VALUE=" & objRS("empName") & ">" 
       response.write "<BR><BR><B>Cell Phone Number:  </B><INPUT TYPE=text" & " " & "NAME=txtcPhone" & " " & "VALUE=" & objRS("empcPhone") & ">" 
    rs.moveNext
    Wend
    rs.close

  3. #3
    Join Date
    Feb 2003
    Posts
    2,745
    Also, is this just a typo?

    urab=request.querystring("id")

    strSQL="SELECT * FROM empInfo WHERE Id= " & curab

  4. #4
    Join Date
    Aug 2004
    Posts
    82
    Yes, thanks!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles