Please Help ....vbscript runtime error!!!!

Results 1 to 3 of 3

Thread: Please Help ....vbscript runtime error!!!!

  1. #1
    Pallavi M Guest

    Default Please Help ....vbscript runtime error!!!!

    hi <BR>I am trying to run the following code. I am getting subscript out of range error . I am assigning a string value from the recordset to rray element . I don&#039t know why I am getting that error....Could anyone please help me ?<BR><BR>On Error Resume next<BR>count =1 <BR>If not rst.EOF or not rst.BOF then<BR> rst.Movefirst<BR> do until rst.EOF=true<BR> if InStr(1, accountopts , rst(0)) &#062; 0 then<BR> arraccopts(count) = ""<BR> arraccopts(count) = cstr(rst(0))<BR> Else<BR> Response.Write count & "no match"<BR> end if<BR> <BR> rst.movenext<BR> count = count + 1<BR> Redim Preserve arraccopts(Ubound(arraccopts) + 1)<BR>Loop<BR>End if <BR><BR>If Err.number &#060;&#062; 0 then<BR>Response.Write Err.number & Err.source & Err.description<BR>Err.clear<BR>End if <BR><BR><BR><BR>Thanks in advance<BR><BR>Pallavi

  2. #2
    Steve Cimino Guest

    Default RE: Please Help ....vbscript runtime error!!!!

    How are you DIMming your array? If you&#039re making it dynamic, you have to do this:<BR><BR>Dim myArray()<BR><BR>ReDim myArray(10)<BR><BR>&#039Now do your stuff

  3. #3
    Pallavi M Guest

    Default RE: Please Help ....vbscript runtime error!!!!

    Thanks alot .I forgot to redim it. it worked

Posting Permissions

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