I am trying to insert an int into one array and a string into another. For some reason I can’t insert the int or string no matter how I try. Here is the code
dim siteList,siteNameList, strQuery
Set oConn = Server.CreateObject("ADODB.Connection")
set oRs = Server.CreateObject("ADODB.Recordset")
oConn.Open strConnQuery
strQuery = "Select zSiteID as id, zSiteNm as Name from vSite"
set ors = oConn.Execute(strQuery)
z=0
Do While Not oRs.EOF
sID=oRs("id")
sName=oRs("Name")
if InStr(oRs("Name"),"'")>0 then
sOut = replace(strorigFileName,"'" ,"")
siteList(z)=sID
siteNameList(z)=sOut
else
siteList(z)=sID(this is where the error occurs first)
siteNameList(z)=sName
end if
z=z+1
oRs.MoveNext
Loop
oConn.Close
I have tried converting it to different things but that hasn’t helped at all. I have no idea what is wrong so any information would be greatly appreciated!
In classic ASP you need to declare a size for arrays: