Often we can see when connecting to a database, opening a recordset as follows:
Rs. Open strSQL, Conn,adopendynamic, adlockpessimistic
When you type "," a cursor type or a list of lock types appears later.
Sometimes we rs.open directly to simplify the strsql,conn,1,3
The first method is not more professional, we look at how ASP to achieve
Open VB6 and create a new ActiveX DLL project. Project name modified to fcom, class name modified to FC5
Option Explicit
' Define enum type
Public Enum Interfacedig
Icfirst = 1
Icsecond = 2
Icthree = 3
Icfour = 4
Icfive = 5
Icsix = 6
Icserven = 7
Iceight = 8
End Enum
' Define function
Public Function Calldat (ByVal idig as Integer, ByVal ICS as Interfacedig) as Variant
Calldat = Idig * ICS
End Function
OK, a component is written, click the menu-> file-> generate FCom.dll file
OK, there will be a FCom.dll file in the directory
Test
Turn on visual interdev6.0 to generate an ASP file
<%@ Language=vbscript%>
<HTML>
<BODY>
<%
' Definition, you can also put this part in a file, just like an ADO recordset <!--#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")
' Here you can use Iceight or 8, but the former makes the code more readable
A= obj. Calldat (4,iceight)
Response.Write A
Response.Write "<br>"
A= obj. Calldat (4,8)
Response.Write A
%>
<P> </P>
</BODY>
</HTML>
Configure the virtual directory, in IE to execute this ASP file, the results are as follows:
32
32