aspose file tools*
The moose likes Servlets and the fly likes MS-Access Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "MS-Access Problem" Watch "MS-Access Problem" New topic
Author

MS-Access Problem

Rani Mukherjee
Greenhorn

Joined: Jan 14, 2001
Posts: 24
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
anand chawla
Ranch Hand

Joined: Oct 19, 2000
Posts: 91
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

Joined: Oct 19, 2000
Posts: 91
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
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
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:


Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: MS-Access Problem