<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1037121" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1037121</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/dictionary-object-asp#comment-1213738</link>
    <description> &lt;p&gt;Hi ben, sorry this wasn&#039;t answered earlier. Is there a specific problem you&#039;re having with this?&lt;/p&gt;
&lt;p&gt;The code above seems like it will work. It&#039;s not very efficient to do a SQL query for every iteration of that loop though, what would be better is to iterate through the dictionary building a string which will be the WHERE clause in your SQL statement.&lt;/p&gt;
&lt;p&gt;Dictionaries are very optimised in ASP (and VB6 too) so are a good choice in this case. You might want to make your loop look a little more like:&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;For i = 0 To objDict.Count - 1&lt;br /&gt;&amp;nbsp; myKey = allkeys(i) &lt;br /&gt;&lt;br /&gt;&amp;nbsp; If i = 0 Then&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sqltext = &amp;quot;Select * from products where product_ID =&amp;quot; &amp;amp; myKey&lt;br /&gt;&amp;nbsp; Else&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sqltext = sqltext &amp;amp; &amp;quot; or product_ID = &amp;quot; &amp;amp; myKey&lt;br /&gt;&amp;nbsp; End If &lt;br /&gt;Next&lt;br /&gt;&lt;br /&gt;sqltext = sqltext &amp;amp; &amp;quot;;&amp;quot;&lt;br /&gt;&lt;br /&gt;cart.Open sqltext, ORSp&lt;br /&gt;cart.MoveFirst&lt;br /&gt;	&lt;br /&gt;while Not cart.EOF&lt;br /&gt;&amp;nbsp; response.write(cart(&amp;quot;PName&amp;quot;)&amp;amp;&amp;quot;&amp;lt;br /&amp;gt;&amp;quot;)&lt;br /&gt;&amp;nbsp; cart.movenext&lt;br /&gt;wend&lt;br /&gt;&lt;br /&gt;cart.close&lt;/code&gt;&lt;/div&gt;&#039;&lt;/p&gt;
&lt;p&gt;Hope this makes sense! It&#039;s been a while since I did any ASP programming so please forgive any errors in that code. &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
 </description>
     <pubDate>Fri, 19 Jan 2007 02:59:16 +0000</pubDate>
 <dc:creator>JeevesBond</dc:creator>
 <guid isPermaLink="false">comment 1213738 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
