R
Robin
Can anyone point me in a good direction to get more info on
scripting.dictionary objects?
Or, maybe someone can see what's wrong with my code ...
I ran this without setting the 'd' to a variable and it worked fine. So I
know it has something to do with the way I'm naming them.
Error I'm getting is on the d.add line and it is:
Error Type:
Microsoft VBScript runtime (0x800A01A8)
Object required: 'd4'
This is the code:
set rsUnique = conn.execute("Select DISTINCT ownerID from Sites Where
customerID =" &session("ID") & " order by ownerID")
while not rsUnique.EOF
dim d
d = "d" & rsUnique("OwnerID")
set d = server.createObject ("Scripting.Dictionary")
rsUnique.MoveNext
wEnd
'*** SCRIPTING DICTIONARY ***
set rsBlah = conn.execute("Select * from Sites where customerID = " &
session("ID") & " 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("ID")
rsName = rsBlah("Name")
rsname2 = rsBlah("OID")
d.Add rsID, rsName&","&rsname2 'THIS IS THE LINE THAT IS STOPPING AT
a = d.Items
b = d.keys
rsBlah.moveNext
wEnd
response.write d.count & "<BR>"
i = 0
for i = 0 to d.count -1
s = s & b(i) & a(i) & "<BR>"
next
response.write s
response.write "done<br>"
scripting.dictionary objects?
Or, maybe someone can see what's wrong with my code ...
I ran this without setting the 'd' to a variable and it worked fine. So I
know it has something to do with the way I'm naming them.
Error I'm getting is on the d.add line and it is:
Error Type:
Microsoft VBScript runtime (0x800A01A8)
Object required: 'd4'
This is the code:
set rsUnique = conn.execute("Select DISTINCT ownerID from Sites Where
customerID =" &session("ID") & " order by ownerID")
while not rsUnique.EOF
dim d
d = "d" & rsUnique("OwnerID")
set d = server.createObject ("Scripting.Dictionary")
rsUnique.MoveNext
wEnd
'*** SCRIPTING DICTIONARY ***
set rsBlah = conn.execute("Select * from Sites where customerID = " &
session("ID") & " 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("ID")
rsName = rsBlah("Name")
rsname2 = rsBlah("OID")
d.Add rsID, rsName&","&rsname2 'THIS IS THE LINE THAT IS STOPPING AT
a = d.Items
b = d.keys
rsBlah.moveNext
wEnd
response.write d.count & "<BR>"
i = 0
for i = 0 to d.count -1
s = s & b(i) & a(i) & "<BR>"
next
response.write s
response.write "done<br>"