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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Field truncation 1

Status
Not open for further replies.

Kris912

Programmer
Jul 29, 2005
27
US
HI!

I am loading distinct Names from a field in a Contractors table to populate a drop down menu, which when you make a choice it will ultimately populate the contractors field in the Projects table. The drop down menu is being populated fine, But when I choose an option and press submit it is truncating that option at the first space. It is making no sence to me...

Here is the code:

<%
set connection = server.createobject("ADODB.Connection")
connection.open session("DBConnString")


sql = "select distinct C_Name from Contractors"
sql = sql & " order by C_Name DESC"
set rs = connection.execute(sql)

%>
<select class="Fieldvalue" size="1" name="Contractor">
<option value="" selected>Select Contractor</option>
<%

While Not rs.EOF
C_Name = rs("C_Name")
response.Write "<option value=" & C_Name & ">" & C_Name & "</option>"
counter = counter +1
rs.MoveNext
Response.Flush()
WEND
%>
</select>
In the action file:

Contractor = Upload.form("Contractor")

I chose not to do a replace(trim(Upload.form("Contractor")),"'","''") because I thought that maybe that was trimming it. Still keeps truncating the Contractor Name.

If I have to hard code the options in the drop down it is goingto defeat the purpose of the client being able to add their contractors to the DB.

Also, Just to be safe I wiped out the Contractors table, compressed and repaired the DB, than reentered the data through the admin interface.

Any Ideas??

Thanks,

Kris912
 
You may try this:
response.Write "<option value='" & C_Name & "'>" & C_Name & "</option>"

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
That did the Trick!! :) Do you have to have the single quotes when it is more than one word? I'm asking because I've used this dynamically before but it was a URL so there were no breaks in the line...so that did fine without single quotes.

Thank you...!!!!

Kris ;)
 
In fact you had an HTML problem, not a SQL one.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top