Parse a string from a field and put in table on webpage

Parse a string from a field and put in table on webpage

am 19.04.2007 20:24:10 von Dan Somdahl

Hi, I am new to ASP but have what should be a fairly simple task that I
can't figure out.
I need to parse a string from a single, semi-colon delimited, 60 character
field (el_text) in a recordset and display the results in a table on a
webpage (ASP)

I can retrieve the recordset from the database and display the field data
results in rows of a table but have the entire 60 character string in one
cell. I need to break that string apart and put each semi-colon delimited
value in it's own cell. Then move to the next record and do the same thing
in the next row of the table. - and so on

I'm using ASP, VB Script with DMSII Database and OLEDB

Does anyone have some code examples on how to break this field apart and
then arrange the data into an html table on a webpage?

Re: Parse a string from a field and put in table on webpage

am 23.04.2007 13:27:58 von unknown

Use the Split function to create an array of your things.

<%
aParts = Split(yourRecordSet.Fields.Item("el_text").Value, ":")
For i = 0 To UBound(aParts, 1)
Response.Write "" & Server.HtmlEncode(aParts(i)) & "" & vbCrLf
Next
%>

Ray at work

"Dan Somdahl" wrote in message
news:C24D1DF9.D3%dankatie9@aol.com...
> Hi, I am new to ASP but have what should be a fairly simple task that I
> can't figure out.
> I need to parse a string from a single, semi-colon delimited, 60 character
> field (el_text) in a recordset and display the results in a table on a
> webpage (ASP)
>
> I can retrieve the recordset from the database and display the field data
> results in rows of a table but have the entire 60 character string in one
> cell. I need to break that string apart and put each semi-colon delimited
> value in it's own cell. Then move to the next record and do the same
> thing
> in the next row of the table. - and so on
>
> I'm using ASP, VB Script with DMSII Database and OLEDB
>
> Does anyone have some code examples on how to break this field apart and
> then arrange the data into an html table on a webpage?
>