Wondering if someone can give me a hand with something that I'm sure is
really easy - but damned if I know what I'm doing wrong. I'm trying to read
the contents of a database into an ASP dictionary object. However I'm
getting the error
Microsoft VBScript runtime error '800a01c9'
This key is already associated with an element of this collection
/test.asp, line 21
There's definately no repeated data in either column, it's currently only
test data, one column is 1,2,3,4 etc the other is a,b,c,d. I can confirm
it's reading the data properly if I use response.write instead of d.add
The code I'm using is this:
Set rsCount = Server.CreateOb ject ("ADODB.Records et")
sqlView = "select data,number from tblTemp"
Set d=Server.Create Object("Scripti ng.Dictionary")
rsCount.Open sqlView, "dsn=dsn_hits_2 "
do while not rsCount.eof
d.add rsCount("number "),rsCount("dat a")
rsCount.MoveNex t
loop
rsCount.close
Set rsCount = Nothing
Many thanks in advance.
really easy - but damned if I know what I'm doing wrong. I'm trying to read
the contents of a database into an ASP dictionary object. However I'm
getting the error
Microsoft VBScript runtime error '800a01c9'
This key is already associated with an element of this collection
/test.asp, line 21
There's definately no repeated data in either column, it's currently only
test data, one column is 1,2,3,4 etc the other is a,b,c,d. I can confirm
it's reading the data properly if I use response.write instead of d.add
The code I'm using is this:
Set rsCount = Server.CreateOb ject ("ADODB.Records et")
sqlView = "select data,number from tblTemp"
Set d=Server.Create Object("Scripti ng.Dictionary")
rsCount.Open sqlView, "dsn=dsn_hits_2 "
do while not rsCount.eof
d.add rsCount("number "),rsCount("dat a")
rsCount.MoveNex t
loop
rsCount.close
Set rsCount = Nothing
Many thanks in advance.
Comment