rlaxton
04-22-2004, 10:13 PM
I'm attempting to create a few scripting.dictionary's depending on a value in a field on each record. The error I'm getting is:
Object required: 'd4'
(stopping on line 50 which is the d.add line ...)
So, this is the code I have so far:
rsUnique = "Select DISTINCT ownerID from Sites Where customerID = "
rsUnique = rsUnique & session(ID)
conn.execute(rsUnique)
while not rsUnique.EOF
dim d
d = "d" & rsUnique("OwnerID")
set d = server.createObject ("Scripting.Dictionary")
rsUnique.MoveNext
wEnd
'*** SCRIPTING DICTIONARY ***
rsBlah = "Select * from Sites where customerID = " & session("ID")
rsBlah = rsBlah & " order by ownerID, siteID")
dim rsID,rsName
while not rsBlah.EOF
If rsBlah("ownerID") <> x Then
d = "d" & rsBlah("ownerID")
End If
i = i + 1
rsID = rsBlah("siteID")
rsName = rsBlah("siteName")
rsname2 = rsBlah("OwnerID")
d.Add rsID, rsName&","&rsname2
a = d.Items
b = d.keys
rsBlah.moveNext
wEnd
for i = 0 to d.count -1
s = s & b(i) & a(i) & "<BR>"
next
response.write s
response.write "done<br>"
I'm Perfectly new to scripting.Dictionary, so bare with me or recommend a site to read up on it all!! What I'm hoping to accomplish from the above is to have a d# for each OwnerID that will list all Sites that fall under that ownerID for use in dynamic <select ...>
Thanks for any input / help!!
Object required: 'd4'
(stopping on line 50 which is the d.add line ...)
So, this is the code I have so far:
rsUnique = "Select DISTINCT ownerID from Sites Where customerID = "
rsUnique = rsUnique & session(ID)
conn.execute(rsUnique)
while not rsUnique.EOF
dim d
d = "d" & rsUnique("OwnerID")
set d = server.createObject ("Scripting.Dictionary")
rsUnique.MoveNext
wEnd
'*** SCRIPTING DICTIONARY ***
rsBlah = "Select * from Sites where customerID = " & session("ID")
rsBlah = rsBlah & " order by ownerID, siteID")
dim rsID,rsName
while not rsBlah.EOF
If rsBlah("ownerID") <> x Then
d = "d" & rsBlah("ownerID")
End If
i = i + 1
rsID = rsBlah("siteID")
rsName = rsBlah("siteName")
rsname2 = rsBlah("OwnerID")
d.Add rsID, rsName&","&rsname2
a = d.Items
b = d.keys
rsBlah.moveNext
wEnd
for i = 0 to d.count -1
s = s & b(i) & a(i) & "<BR>"
next
response.write s
response.write "done<br>"
I'm Perfectly new to scripting.Dictionary, so bare with me or recommend a site to read up on it all!! What I'm hoping to accomplish from the above is to have a d# for each OwnerID that will list all Sites that fall under that ownerID for use in dynamic <select ...>
Thanks for any input / help!!