• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

MS-Access Problem

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Friends,
I am working with servlets, using JSDK2.0 & MS-Access as database.
I have a table with column name Address & having a value "251, Anna Salai, Chennai-33" in that column. I want to display this in a textfield of HTML page. I used following code:
out.println("<tr><td>Address:</td><td><input type=text name=City value="+rs.getString(5)+"></td></tr>");
The problem is it is displaying only 251 in the textfield. But, I want to display complete string. How to do it? Please help.
Rani
 
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i think what i told may be wrong try this thing
instead of this one
out.println("<tr><td>Address:</td><td><input type=text name=City value="+rs.getString(5)+"></td></tr>");

out.println("<tr><td>Address:</td><td><input type=text name=City value='"+rs.getString(5)+"'></td></tr>");
just copy and paste this in ur code
it will work
[This message has been edited by anand chawla (edited February 22, 2001).]
 
anand chawla
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
the problem lies in the spacing
instead of ur statment
out.println("<tr><td>Address:</td><td><input type=text name=City value="+rs.getString(5)+"></td></tr>");
try this one the mistake is the value in address field in database.Just reduce the spacing between 251 and Anna and following ones.because value doesnt take anything after space.
just remove space in database and try it shold work
 
Sheriff
Posts: 7001
6
Eclipse IDE Python C++ Debian Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As an aside, you should always quote values for all tag attributes. Both strict HTML and XML require that all attribute values are quoted, and getting into the habit will help prevent misunderstandings like this. I suggest generating HTML like the following:
 
If you try to please everybody, your progress is limited by the noisiest fool. And this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic