How do I write, using VB to write a DLL from the data table to return array (part of the source code), please look at prawns, I hope that the owner can put into the essence

Source: Internet
Author: User
Option Explicit
Private Myerrobj as Errorcls
Private ScriptingContext as ScriptingContext
Private Request as Request
Private Response as Response
Private Server as Server
Private Session as session
Dim DBPath
Dim Dbprovider as String
Public Sub OnStartPage (Passedscriptingcontext as ScriptingContext)
Set ScriptingContext = Passedscriptingcontext
Set request = Scriptingcontext.request
Set response = Scriptingcontext.response
Set Server = Scriptingcontext.server
Set session = Scriptingcontext.session
Set myerrobj = New errorcls
DBPath = Server. MapPath ("Xx9601.mdb")
' Connect with an ODBC data source
Dbprovider = "dsn=xx9601;uid=;p wd="
' Dbprovider = Driver={microsoft Access Driver (*.mdb)};d bq= "& DBPath
End Sub
Public Sub OnEndPage ()
Set ScriptingContext = Nothing
Set request = Nothing
Set response = Nothing
Set Server = Nothing
Set session = Nothing
Set myerrobj = Nothing
End Sub
Private Function GetAll (adocnn as ADODB. Connection, scmd as String)
Dim adors as ADODB. Recordset
Dim Arrayado ()
Dim Ivar
Dim Jvar

On Error Resume Next
Set adors = New ADODB. Recordset
Adors.open Scmd, ADOCNN, 3, 1
If adoCnn.Errors.Count > 0 Or adors.eof Then
GetAll = Null
Set adors = Nothing
Exit Function
End If
ReDim Arrayado (adors.recordcount-1, adors.fields.count-1)
For Ivar = 0 to Adors.recordcount-1
For Jvar = 0 to Adors.fields.count-1
Arrayado (Ivar, Jvar) = Trim (Adors.fields (Jvar))
Next
Adors.movenext
Next
Set adors = Nothing
' VB6 Array Assignment method
GetAll = Arrayado
End Function
Public Function gettoary (PWD as Integer, scmd as String)

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.