ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old July 21st, 2003, 01:38 PM
garetjax garetjax is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Colorado
Posts: 1 garetjax User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to garetjax Send a message via AIM to garetjax Send a message via Yahoo to garetjax
Whats wrong with this!!!!

if request.querystring("lookup") = "True" then
skus = Trim(replace(request.form("skus")," ",""))
skus = replace(skus,Chr(10),",")
skus = replace(skus,Chr(11),",")
skus = replace(skus,Chr(12),",")
skus = replace(skus,Chr(13),",")
vSkus = split(skus, ",")
Set dict1=Server.CreateObject("Scripting.Dictionary")
Set dict2=Server.CreateObject("Scripting.Dictionary")
Set rs = Server.CreateObject("ADODB.Recordset")
for i = 0 to ubound(vSkus)
dict1.Add trim(vSkus(i)), i
next
sSQL = "SELECT [Product Name], [Standard Code] FROM PC_Query;"
rs.Open sSQL, sConnAnket
rs.movefirst
for each objItem in rs.fields
do while not rs.eof
dict2.add rs("Product Name"),rs("Standard Code")
cnt = cnt + 1
rs.movenext
loop
next
Set rs = Nothing
rs.close
ver_sku=dict1.keys
ver_count=dict1.items
vl_sku = dict2.keys
vl_unspsc = dict2.items
for i = 0 to dict2.count-1
if dict1.Exists(v1_sku)= true then
Response.Write ("Found Matching SKU")
else
Response.Write("SKU Does not have a UNSPSC")
end if
next
response.write "<br>Searched " & cnt & " records."


I cannot get the damned thing to compare Dict1.key to Dict2.Key then post the results if same of dict2.key & dict2.item


Help me....help me...I'm lost in a see of cumbersome dictionary objects.

Reply With Quote
  #2  
Old July 22nd, 2003, 08:52 AM
ngibsonau ngibsonau is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Posts: 138 ngibsonau User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Your example is a little too busy for anybody to answer your question at a glance. You would be better to trim it down to the bare minimum and also give an examplae html form that post the data as well.

All this said and having not tried to run any of your code, you would be well advised to print out the typename of all things that you place into and get out of the dictionaries.

Dictionaries have a habit of putting things in under odd types.
ie. if an integer comes out of a database recordset and is added to a dictionary it is sometimes saved in the dictionary with a typename of "field" or possibly "variant" or even "integer".
You should explicitly cast variables to a known types before adding to a dictionary using CInt, CFloat, CSting etc. You should probably convert the variable to the same typename before you compare them also.

If this is not what the problem is, I'm sure a more simplified example will clearly show what the problem is.
__________________
--

ngibsonau

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > Whats wrong with this!!!!


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway