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