Results 1 to 2 of 2

Thread: Split/Array

  1. #1
    Join Date
    Dec 1969

    Default Split/Array

    I have multiple values in the same field in my database so I was using the split function which gave the results to an array. I am new to ASP so I do not know much about arrays. I know how to list some of the array if I know just how many values there are (by doing sArray(number)) yet the number of values will be different for each record. If there is a simple way to do this please tell me.

  2. #2
    Join Date
    Dec 1969

    Default Bad DB design...

    You should take the field with the multiple entries and make it into a separate table. This is called "normalization."<BR><BR>Having said that:<BR><BR>&#060;%<BR>Set RS = ... get the recordset ...<BR><BR>DO Until RS.EOF<BR> values = Split( RS("multiField"), "," )<BR> For i = 0 To UBound( values )<BR> oneValue = values(i)<BR> ... do whatever you need with this value ...<BR> Next<BR> ...<BR> RS.MoveNext<BR>Loop<BR>%&#062;<BR><BR><BR>But you *really* should consider rebuilding that DB.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts