Dropping a comma

M

Micromanaged

I am trying to post some data from the database to an XML file.
Everything works except for a stray comma that comes from the database
and exists at the end of the address string. For example, "123 Anywhere
Street,"

I would like to kill that comma that will always exist at the end of the
address string.

My initial thoughts:

oldaddr = request.form(business_address)
vbl = len(address) - 1
newaddr = left(oldaddr, vbl)

I tell it to do response.write on all variables involved, but for some
reason the calculation is not being performed. No errors. What am I
missing?
 
A

Aaron [SQL Server MVP]

oldaddr = request.form(business_address)

Uh, did you mean

oldaddr = request.form("business_address")

Big difference, with quotes and without. If that's what you actually have,
than kindly cut & paste your actual code instead of re-writing it from
memory.
 
M

Mark Schupp

Are you sure the comma is always the last character (could there be a
trailing blank perchance)?
 
M

Micromanaged

I did screw up in the leaving out the quotes from the request.form when
I posted my original comments. I made the change to the following line:
oldaddr = request.form("business_address")
and changed it to:
oldaddr = trim(request.form("business_address"))
which solved the problem.

Thanks for the input (it was at least 1 trailing space).
 
M

Mark Schupp

You probably have a duplicate field name in the form. The 2 form field
values would be separated by a comma and a blank when received from the
form.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top