Dictionary problem

Results 1 to 2 of 2

Thread: Dictionary problem

  1. #1
    Join Date
    Dec 1969

    Default Dictionary problem

    I have a dictionary problem that makes no sense since it follows MS code EXACTLY!!<BR><BR> Do While (Not rst.EOF)<BR> Settings.Add rst.Fields("strName"), rst.Fields("strValue")<BR> rst.MoveNext<BR> Loop<BR>Settings is a Dictionary object.<BR><BR>I get the following error:<BR>This key is already associated with an element of this collection<BR><BR>I looked at a Debug print of the collection and each key IS changing. Adds 2 entries then goes BOOM! Kinda been a lousy day for me... sob...<BR><BR>Sparky

  2. #2
    Join Date
    Dec 1969

    Default Try explicitly using...

    ...the .VALUE properties.<BR><BR>You *can* add OBJECTS to a dictionary, and I can&#039;t help but wonder if, when you add<BR> rst.Fields("strName")<BR>that the system doesn&#039;t try to add the ADODB.Field object that you are referencing there.<BR><BR> Settings.Add rst.Fields("strName").Value, rst.Fields("strValue").Value<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts