Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Reply
changing item value in dictionary object
Old 08-16-2005, 08:12 AM changing item value in dictionary object
numbenator's Avatar
Webmaster Talker

Posts: 516
Location: London
Trades: 0
Hi.
(problems updating the item in dictionary object)

I have 2 tables. portals and referals.
each portal has a referal against it (1 of upto 6) .
Referals in my dictionary will be keys and each key will maintain a count. (item)
I wish to count the number of different referals for each portal.


MY sub is below. I think i correctly create the keys but after i then get the portals to begin a check , I dont know how to update the item with + 1
The code i am missing is below if stat.Exists(portReferal)= true then :

Code:
sub getStats() 
 
    'get the referals
    Set RS   = Server.CreateObject("ADODB.Recordset") 
	set stat = Server.CreateObject("Scripting.Dictionary")
    strSQL = "SELECT * FROM referals"
    RS.Open strSQL, Conn 
	arrayCol=0
	arrayRow=0
	RS.MoveFirst 
	
	do while not RS.EOF
	      stat.add RS("referal"),0
	   RS.movenext 
	loop
	
	set RS=nothing
	Set RS = Server.CreateObject("ADODB.Recordset") 
	strSQL = "SELECT * FROM comments where portal="request.queryString("portal")
	RS.Open strSQL, Conn 
	RS.MoveFirst  
	
	do while not RS.EOF
	     portReferal=RS("referal")
		 for i = 0 To stat.Count -1
		    if stat.Exists(portReferal)= true then
               'how do I update the item here???????????????			end if
         next
    RS.movenext
	loop
	
end sub
__________________

Please login or register to view this content. Registration is FREE
numbenator is offline
Reply With Quote
View Public Profile Visit numbenator's homepage!
 
 
Register now for full access!
Old 08-16-2005, 08:06 PM
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Code:
stat.item(portreferal) = stat.item(portreferal) + 1
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 08-18-2005, 05:13 AM
numbenator's Avatar
Webmaster Talker

Posts: 516
Location: London
Trades: 0
wicked. thanks very much. works fine.
__________________

Please login or register to view this content. Registration is FREE
numbenator is offline
Reply With Quote
View Public Profile Visit numbenator's homepage!
 
Reply     « Reply to changing item value in dictionary object
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.24200 seconds with 12 queries