ASP programming notes

Source: Internet
Author: User

In ASP, if <% option explicit %> is added to the file headerProgramAll variables in

Define dim Varia before use.

When we use aspjpeg 2.0 for background image compression and the result is set JPEG = server. Createobject ("persits. jpeg,

No way. Solved the aspjpeg installation, and repeatedly verified that its installation directory could be accessed by everyone, but the result still failed,

After one afternoon, I found that this mark was added in front of the program.CodeTo:

Dim JPEG
Set JPEG = server. Createobject ("persits. jpeg ")

The problem is solved smoothly. Of course, other variables in the classic image compression code extracted from the Internet also need to be declared one by one before they can be used.

 

Binary type conversion

Generally, the ID in the database is either Int or bigint. If it is int type, the VBScript needs to convert it: CINT (RS ("ID "));

If it is bigint, clng function conversion is used: clng (RS ("ID ")).

The above is the field conversion in the database, and the value transfer between ASP pages also needs to be converted:

Id = request. querystring ("ID ")

Id = CINT (ID)

Or: Id = clng (ID)

Generally, the ID parameter values passed in the project are directly obtained from the database. After passing the parameter values, you must compare them with the data in the database again.

At the same time, convert the passed parameters and the IDS extracted from the database to the following types:

If the database ID is of the bigint type, the judgment statement is as follows:

If clng (request. querystring ("ID") = clng (RS ("ID "));

If the database ID is int type, the judgment statement is as follows:

If CINT (request. querystring ("ID") = CINT (RS ("ID "));

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.