ASP Component beginner and proficient Series 5

Source: Internet
Author: User

We often see the following when connecting to the database and opening the record set:

Rs. Open strsql, Conn, adopendynamic, adlockpessimistic

When you type ",", a cursor type or lock type list is displayed.

Sometimes, for simplicity, Rs. Open strsql, Conn, 1, 3

The first method is more professional. Let's take a look at how to implement it in ASP.

 

Open VB6 and create an ActiveX dll project. Change project name to fcom and class name to fc5

Option explicit

'Define Enumeration type

Public Enum interfacedig

Icfirst = 1

Icsecond = 2

Icthree = 3

Icfour = 4

Icfive = 5

Icsix = 6

Icserven = 7

Iceight = 8

End Enum

 

'Define a function

Public Function calldat (byval idig as integer, byval ICs as interfacedig) as Variant

Calldat = idig * ICS

End Function

 

OK, a component is ready. Click the menu> File> Generate the fcom. dll file.

OK. The fcom. dll file will appear in the directory.

 

Test

Open visual interdev6.0 and generate an ASP file

 

<% @ Language = VBScript %>

<HTML>

<Body>

<%

'Definition, you can also put this part in a file, just like the ADO record set <! -- # Include file = "adovbs. Inc" -->

Const icfirst = 1

Const icsecond = 2

Const icthree = 3

Const icfour = 4

Const icfive = 5

Const icsix = 6

Const icserven = 7

Const iceight = 8

 

Set OBJ = server. Createobject ("fcom. fc5 ")

'The iceight or 8 can be used here, but the former makes the code more readable.

A = obj. calldat (4, iceight)

Response. Write

Response. Write "<br>"

A = obj. calldat (4, 8)

Response. Write

%>

<P> & nbsp; </P>

 

</Body>

</Html>

 

Configure the virtual directory and execute the ASP file in IE. The result is as follows:

32
32

Related Article

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.