Bureau wait a key population control system, find a lot of finished products, on an ASP and our 70% similar, use it to change it! Now tutorial under ASP
One: About the type of ASP.
This problem is caused by the use of scripting.dictionary.
Set dic = Server.CreateObject ("Scripting.Dictionary")
Set rs = Server.CreateObject ("Adodb.recordset")
sql = ....
Rs.Open sql,conn,1,1
For I=1 to Rs.recordcount
Dic.item (RS ("ClassID")) =rs ("classname")
Rs.movenext
Next
If rs.state<> then//Here the judgment of the state, tested and run accurately!
Rs.close
End If
The above operation in DIC is not the value we want, when for example classid = classname = "police Station".
If this value is taken:
Dic.item ("21")
When executing this statement, DIC produces a null entry of key = 21, stating that the type of assignment at the beginning is incorrect. Type conversions must be made:
Key1 = RS ("ClassID")
Val1 = RS ("classname")
Dic.item (key1) = Val1;
The correct result is obtained by converting the type type above. If you feel that ASP now has a regular hash table available, do not be too happy, the article on the web said that DiC saved to the appliction variable will cause the system to crash.
Mom pull a son of, ASP there is no normal data structure, linked table hash tree These, there is no built-in, session appliction such a server object can be used as a normal hash table? Unless you run out of time to destroy, will not produce a lot of garbage, no complete data structure, resulting in ASP no one use, also today I took out will use, but also for the progress of no way.
Add:
There is a way, the session can be used as a normal hash table in the function between the use of values, so that is found in a timely way to destroy it:
Session.Contents.remove (Key)
This will immediately destroy the session (key)
If Session ("Sesname") =empty Then
Response.Write ("Empty")
This code is verified by the outer guest, the execution is accurate!
End If
Http://www.w3school.com.cn/asp/asp_applications.asp
This learning site is neat and tidy.
Tutorial under ASP