Avatar of MayoorPatel
MayoorPatel
 asked on

Type mismatch: 'Lbound'

I have a piece of code which is looping through a recordset, and also has a nested loop which trys to loop through an array, however apon executing this code I get this error

Microsoft VBScript runtime error '800a000d'
Type mismatch: 'Lbound'

/commsform/admin_detail.asp, line 415

The array is definately not empty. This is how it is crerated

If objRSCampaignChannels.EOF AND objRSCampaignChannels.BOF Then
      Do Until objRSCampaignChannels.EOF
            RSCampaignChannels = RSCampaignChannels & objRSCampaignChannels("ChannelID") & " "
      objRSCampaignChannels.MoveNext
      Loop
      objRSCampaignChannels.Close
      Set objRSCampaignChannels = Nothing
      CampaignChannels = Split(Trim(RSCampaignChannels))
End If

I have attatched the code that calls it.

<tr>
        <td>Comms Channels..</td>                         
        <td> <table>
        <%
		  x = 0
		   Do Until objRSCommsChannels.EOF                
				 If x = 0 Then
						%>
 
						  <tr>
				  
						<%
				 End If		
			 	 
				 For i = Lbound(CampaignChannels) to Ubound(CampaignChannels)
					 %>					 
						<td width="192" align="right" bgcolor="#EEF1F8" id="Td1"><strong><%=objRSCommsChannels.Fields("ChannelDesc")%> </strong></td>
						<td width="32" align="center" bgcolor="#EEF1F8" id="Td2">
						<strong>
						  <label> <input type="checkbox" name="commschannel" value="<%=objRSCommsChannels.Fields("ChannelId")%>"></label>
						</strong>
						</td>      
					 <%
				 Next
				 													   
				 If x = 3 Then
						%>
 
						  </tr>
						<%
						x = 0
				 Else 
					   x = x + 1
				 End If
		
		   objRSCommsChannels.MoveNext
		   Loop
		   objRSCommsChannels.Close
		   Set objRSCommsChannels = Nothing
		 %>
 
        
        </tr>

Open in new window

ASP

Avatar of undefined
Last Comment
Pratima

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Pratima

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23