Ask a Question related to ASP Database, Design and Development.
-
Steve G #1
String Manipulation Before Posting to a Database
Hi All:
I am having difficulty with manipulating data coming from a form which is
then posted to a database. The from contains a mixture of check boxes, and a
text box for "other" with a default value of NA, all of which have the same
name value of specialty.
When I complete the form, and send it to a page to post to the database, a
response.write for the form field delivers a comma delimited list of
"items", which is what I expected, such as:
Allergy and Immunology, Anesthesiology, NA
If the text box is filled in then I would get:
Allergy and Immunology, Anesthesiology, Test
When the text field is NA, I want to eliminate it from the text string, so I
end up with:
Allergy and Immunology, Anesthesiology
Before splitting on the comma, and posting to the database.
I can get rid of the NA doing this:
strTemp = request.form("specialty")
strTemp1 = replace(strTemp,"NA"," ")
This yields:
Allergy and Immunology, Anesthesiology,
Note the trailing comma..if I leave it in, I get an extra blank record in
the database...but I cannot figure out how to get rid of it.
Any help would be greatly appreciated.
Steve G
Steve G Guest
-
String Manipulation - Easiest Way?
I have a field in a database that contains records that look like this: I'm trying to find the easiest (i.e. fewest lines of code) way to strip... -
Another String Manipulation Question
Let's say I have a variable like this: 12345432112347890 The characters in the variable will always be different, but my goal will always be... -
String manipulation
Hi! I am trying to figure out a simple, Perl way to break down any sting similar to the following: $s0 =... -
String manipulation and category building.
I have been working in this problem for weeks and I was determined to sort it myself however I feel I need guidance to proceed forward. What I am... -
string manipulation problem - Replace
Hi all, I'm new to ASP so this is probably a problem caused by me.... but here goes. I have been pulling some information from an access database... -
Bob Barrows #2
Re: String Manipulation Before Posting to a Database
Steve G wrote:
How about:> Hi All:
>
> I am having difficulty with manipulating data coming from a form
> which is then posted to a database. The from contains a mixture of
> check boxes, and a text box for "other" with a default value of NA,
> all of which have the same name value of specialty.
>
> When I complete the form, and send it to a page to post to the
> database, a response.write for the form field delivers a comma
> delimited list of "items", which is what I expected, such as:
> Allergy and Immunology, Anesthesiology, NA
>
> If the text box is filled in then I would get:
> Allergy and Immunology, Anesthesiology, Test
>
> When the text field is NA, I want to eliminate it from the text
> string, so I end up with:
> Allergy and Immunology, Anesthesiology
> Before splitting on the comma, and posting to the database.
>
> I can get rid of the NA doing this:
> strTemp = request.form("specialty")
> strTemp1 = replace(strTemp,"NA"," ")
>
> This yields:
> Allergy and Immunology, Anesthesiology,
>
> Note the trailing comma..if I leave it in, I get an extra blank
> record in the database...but I cannot figure out how to get rid of it.
strTemp1 = replace(strTemp,", NA","")
Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Bob Barrows Guest
-
Steve G #3
Re: String Manipulation Before Posting to a Database
Great <S>
Thanks Bob...I must have tried 20 variations on that theme, but just could
not get it right.
Steve G
"Bob Barrows" <reb01501@NOyahoo.SPAMcom> wrote in message
news:O2Md3x62DHA.1672@TK2MSFTNGP12.phx.gbl...> Steve G wrote:>> > Hi All:
> >
> > I am having difficulty with manipulating data coming from a form
> > which is then posted to a database. The from contains a mixture of
> > check boxes, and a text box for "other" with a default value of NA,
> > all of which have the same name value of specialty.
> >
> > When I complete the form, and send it to a page to post to the
> > database, a response.write for the form field delivers a comma
> > delimited list of "items", which is what I expected, such as:
> > Allergy and Immunology, Anesthesiology, NA
> >
> > If the text box is filled in then I would get:
> > Allergy and Immunology, Anesthesiology, Test
> >
> > When the text field is NA, I want to eliminate it from the text
> > string, so I end up with:
> > Allergy and Immunology, Anesthesiology
> > Before splitting on the comma, and posting to the database.
> >
> > I can get rid of the NA doing this:
> > strTemp = request.form("specialty")
> > strTemp1 = replace(strTemp,"NA"," ")
> >
> > This yields:
> > Allergy and Immunology, Anesthesiology,
> >
> > Note the trailing comma..if I leave it in, I get an extra blank
> > record in the database...but I cannot figure out how to get rid of it.
> How about:
> strTemp1 = replace(strTemp,", NA","")
>
> Bob Barrows
> --
> Microsoft MVP -- ASP/ASP.NET
> Please reply to the newsgroup. The email account listed in my From
> header is my spam trap, so I don't check it very often. You will get a
> quicker response by posting to the newsgroup.
>
>
Steve G Guest



Reply With Quote

