Tutorial under ASP

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.