Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dictionary Object

Status
Not open for further replies.

mgonzalez

Programmer
Aug 2, 2000
51
MX

Someone know if the Dictionary Objets can be used like session objetcs?.The thing is that when I make a normal dictionary object like this

Set dictf = server.CreateObject("Scripting.dictionary")

I can see the methods but if do something like this:

Set session(dictf) = server.CreateObject("Scripting.dictionary")

Is posible this?

Thanks
 
Microsoft suggests not using the dictionary object in ASP pages because the developers mistakenly marked it as free threaded, while it's not, it's apartment threaded. You should use the lookuptable object instead.

[ignore]

[/ignore]

By the way, storing a reference to an apartment-threaded object in a session variable is a thing you want to avoid if you want your application to scale well. There are hundreds of articles on the various ASP related sites that explain why.
[sig]<p>nick bulka<br><a href=mailto: > </a><br><a href= </a><br>Get your technical books at Bulka's Books<br>
[/sig]
 
Then Could I use a session(array)? . Like this?

---file1.asp---
<%
'Creating and initializing the array
Dim MyArray()
Redim MyArray(5)
MyArray(0) = &quot;hello&quot;
MyArray(1) = &quot;some other string&quot;

'Storing the array in the Session object
Session(&quot;StoredArray&quot;) = MyArray

Response.Redirect(&quot;file2.asp&quot;)
%>

---file2.asp---
<%
LocalArray = Session(&quot;StoredArray&quot;)
LocalArray(1) = &quot; there&quot;

Response.Write(LocalArray(0)&LocalArray(1))

%>




I have been using this but when want to use the session(array)(LocalArray) a cant retrieve the values from the array ,I checked the if the array in file 1 has been created well and is OK but the the problem is in the file 2 when I want retrieve the values also whith response.write [sig][/sig]
 
Addinng to the previous response and after of read the the documents in the link I can see that the lookup object is so useful but has the inconvenient of acts like a Dictionary only after you load it with data, which I must do from a text file.

The thing is that I want keep the values from a form before check it their values and return to the form if the values isn´t OK ,keeping them in a object to fill the field again whith the dta in the object.

Is there any way to resolve this without use object like use some instruction to return to the previous data like the button back in the Browser?

Thanks [sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top