scripting.dictionary

Using a dictionary object in application scope in Classic ASP

邮差的信 提交于 2019-12-23 12:28:57
问题 Following up from my last question does anyone know how I can use a dictionary object in application scope in Classic ASP? You cannot use Scripting.Dictionary - if you try you will see something similar to the following: Application object error 'ASP 0197 : 80004005' Disallowed object use /xxx.asp, line 2. Cannot add object with apartment model behavior to the application intrinsic object. I found this article on (good ol') 4GuysFromRolla but it points to Microsoft's free Lookup Component and

VBA Scripting.dictionary run-time error '13' type mismatch

你。 提交于 2019-12-13 03:48:18
问题 I have written code to go through two columns, one will be the key and the other item/items. It goes through and finds the keys, if it finds a duplicate it adds it to the items along with the previous item. The problem comes when I try to print out the items. The keys print out fine but the items give me the run-time error '13' type mismatch. Here is the code. Sub All() Worksheets("All").Activate Dim Server As Variant Dim Application As Variant Dim colLength As Variant Dim dict As Object Dim

VBScript: Sorting Items from Scripting.Dictionary

末鹿安然 提交于 2019-12-10 23:28:35
问题 I have the code below... it grabs data like this: name1, name4, name2, name3 and list like this ([ ] is a checkbox): [ ] name 1 [ ] name 4 [ ] name 2 [ ] name 3 <% Set DicionarioMyData = CreateObject("Scripting.Dictionary") Set MyData= TarefasConexaoMSSQL.Execute("SELECT A FROM TABLE") If Not MyData.EOF Then Do While Not MyData.EOF ItensDoMyData = MyData("A") If Not IsNull(ItensDoMyData) Then ItensSeparadosDoMyData = Split(ItensDoMyData, ",") For i = 0 To UBound(ItensSeparadosDoMyData)

Scripting.Dictionary Lookup-add-if-not-present with only one key search?

陌路散爱 提交于 2019-12-06 11:03:32
问题 I am looking up keys in a Scripting.Dictionary to make sure I add them (and their items) only once to the dictionary: If MyDict.Exists (Key) Then ' first internal key-value lookup Set Entry=MyDict.Item (Key) ' Second internal key->value lookup else Set Entry=New ItemType MyDict.Add Key,Entry End If ' Now I work on Entry... Exists looks up the key in the dictionary, and Item () does it, too. So i get two key lookups for one logical lookup operation. Isn't there a better way? The dox for the