Ask a Question related to ASP Database, Design and Development.
-
Arne de Booij #1
Comma delimited array into DB problems
Hi,
I have an asp page that takes input from a form on the previous page,
puts that into an array and inserts the array into SQL server.
Now here is the problem:
The form on the page where the user can enter information contains a
dynamic amount of text boxes with the same name. So when the user
submits their entry, I get a comma delimited string.
e.g. First entry, Second entry, Third entry
The problem comes when a user enters a comma in the text field
e.g. First entry, with a comma, Second entry, Third Entry.
My code will put "with a comma" into a different row in the DB than
"First entry" because of the comma in the string.
Any ideas on how to solve this?
CODE (somewhat simplified)
Detailsvar = request("details")
details = Replace(Detailsvar, "'", "''") 'array
Dim deArray
deArray = Split(details, ", ")
FOR i = Lbound(deArray) TO Ubound(deArray)
DB.Execute("sp_insert_ratings '" & deArray(i) & "'")
NEXT
Arne
*** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!
Arne de Booij Guest
-
query against comma delimited field
I can't seem to find out how to do this correctly. I have a field with comma delimited text that I need to query against to find a match. ... -
Reading a Comma Delimited File
Hello all, So as the title says, I need to read a comma delimited file generated by MS Excel. I know that by doing GetListAt() or ListLen()... -
comma delimited list problem
I have a comma delimited list that is loaded into flash using loadvars. How can I convert it into an array? thanks in advance. Shaun -
Splitting Comma delimited list
Hello everyone, I use the following to split a comma delimited list and get varying results and I don't understand why. my count of the... -
generate CSV or comma delimited
What's the easiest way to generate CSV or a comma delimited file from an ASP recordset? I've seen a few searching the internet and they appear to be... -
Ray at #2
Re: Comma delimited array into DB problems
Please do not multipost.
Ray at work
"Arne de Booij" <a_de_booij@hotmail.com> wrote in message
news:uZZtQCv7DHA.4060@tk2msftngp13.phx.gbl...> Hi,
>
> I have an asp page that takes input from a form on the previous page,
> puts that into an array and inserts the array into SQL server.
>
> Now here is the problem:
>
> The form on the page where the user can enter information contains a
> dynamic amount of text boxes with the same name. So when the user
> submits their entry, I get a comma delimited string.
>
> e.g. First entry, Second entry, Third entry
>
> The problem comes when a user enters a comma in the text field
>
> e.g. First entry, with a comma, Second entry, Third Entry.
>
> My code will put "with a comma" into a different row in the DB than
> "First entry" because of the comma in the string.
>
> Any ideas on how to solve this?
>
>
> CODE (somewhat simplified)
>
> Detailsvar = request("details")
> details = Replace(Detailsvar, "'", "''") 'array
>
> Dim deArray
> deArray = Split(details, ", ")
>
> FOR i = Lbound(deArray) TO Ubound(deArray)
> DB.Execute("sp_insert_ratings '" & deArray(i) & "'")
> NEXT
>
> Arne
>
>
>
> *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
> Don't just participate in USENET...get rewarded for it!
Ray at Guest
-
Chris Hohmann #3
Re: Comma delimited array into DB problems
"Arne de Booij" <a_de_booij@hotmail.com> wrote in message
news:uZZtQCv7DHA.4060@tk2msftngp13.phx.gbl...[url]http://groups.google.com/groups?selm=e28zW%24p5DHA.2736%40TK2MSFTNGP09.phx. gbl[/url]> Hi,
>
> I have an asp page that takes input from a form on the previous page,
> puts that into an array and inserts the array into SQL server.
>
> Now here is the problem:
>
> The form on the page where the user can enter information contains a
> dynamic amount of text boxes with the same name. So when the user
> submits their entry, I get a comma delimited string.
>
> e.g. First entry, Second entry, Third entry
>
> The problem comes when a user enters a comma in the text field
>
> e.g. First entry, with a comma, Second entry, Third Entry.
>
> My code will put "with a comma" into a different row in the DB than
> "First entry" because of the comma in the string.
>
> Any ideas on how to solve this?
>
>
> CODE (somewhat simplified)
>
> Detailsvar = request("details")
> details = Replace(Detailsvar, "'", "''") 'array
>
> Dim deArray
> deArray = Split(details, ", ")
>
> FOR i = Lbound(deArray) TO Ubound(deArray)
> DB.Execute("sp_insert_ratings '" & deArray(i) & "'")
> NEXT
>
> Arne
>
>
>
> *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
> Don't just participate in USENET...get rewarded for it!
Chris Hohmann Guest
-
Unregistered #4
Re: Comma delimited array into DB problems
trap and convert the inputted text with comma using replace
‚ = comma
mytext = replace(mytext,",","‚")Unregistered Guest



Reply With Quote

