Jump to content

Dictionary


Guest milns
 Share

Recommended Posts

I am trying to set up dictionary objects from the contents of a sdb database via an ODB object. I can load the dictionary OK but when I complete the Do loop I cannot access the contents of the dictionary although the Count return the right answers - can I overcome this problem?Sample code dim rsFAQs, FaqNum, Heading Set rsFAQs=Server.CreateObject("ADODB.recordset") Set FaqNum=Server.CreateObject("Scripting.Dictionary") Set Heading=Server.CreateObject("Scripting.Dictionary") sql = "SELECT * FROM FAQs ORDER BY FaqNum" faq = 0 rsFAQs.Open sql, conn Do Until rsFAQs.EOF faq = faq + 1 FaqNum.Add faq, rsFAQs("FaqNum") Heading.Add faq, rsFAQs("Heading")rw("loaded FAQ # " & FaqNum.Item(faq) & " Heading " & Heading.Item(faq) & "<BR>") rsFAQs.MoveNext Loop faq = 1rw("Another look at FAQ # " & FaqNum.Item(faq) & " Heading " & Heading.Item(faq) & "<BR>")rw is a function to do a response.writeThe rw inside the loop worksThe rw after the loop fails with error '80020009'I think the problem is something to do with passing rsFAQs.EOF - is there any way of resetting this indicator?ThanksDennis Milns

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...