I have already had a quick search through the FAQs, but couldn't find anything on this subject and my code keeps giving me errors, so if anyone could help...
Basically I am trying to create an array and then call specific elements from the array to use in an SQL statement.
x=0
dim SplitArray()
'SQL statement calling several con_id
while not rs.eof
redim SplitArray(x)
SplitArray(x) = rs("con_id")
response.write(x &": "& SplitArray(x) &"<br />")
x = x + 1
rs.movenext
wend
The response.write above returns the id, which I believe shows that the Array is being populated. However whenever I then try to call any array element, for example:
p_arrayelement = SplitArray(12)
It returns SplitArray as a blank value.
Am I missing out something where I set the items within the array or am I calling the array incorrectly? Just a couple of ideas I had but I can't find anything anywhere online.
Thanks for your help.
Basically I am trying to create an array and then call specific elements from the array to use in an SQL statement.
x=0
dim SplitArray()
'SQL statement calling several con_id
while not rs.eof
redim SplitArray(x)
SplitArray(x) = rs("con_id")
response.write(x &": "& SplitArray(x) &"<br />")
x = x + 1
rs.movenext
wend
The response.write above returns the id, which I believe shows that the Array is being populated. However whenever I then try to call any array element, for example:
p_arrayelement = SplitArray(12)
It returns SplitArray as a blank value.
Am I missing out something where I set the items within the array or am I calling the array incorrectly? Just a couple of ideas I had but I can't find anything anywhere online.
Thanks for your help.