Active connection occurs problem (asp, vb dll , Oracle) but no error message to be raised 
Author Message
 Active connection occurs problem (asp, vb dll , Oracle) but no error message to be raised

Dear Sir/Madam,

Please help me to solve the problem.  Thanks.

A problem is occurred in the vb Active X DLL
I declare the global variable for connection and connection string in
The connection function and call stored procedure function are in the
clsPublic.cls, which set the Instancing to GlobalMultiUse.
The database is Oracle 8.02.06 and middle-tier is VB 6.0 (dll).  I
compiled it in the Active X DLL.
After that, ASP file to be called by browser, which ASP file to call
the clsRegister and pass in the parameter through IIS.
( ASP file ---> clsRegister.cls object ---> Call_SP_Oper function )
This function can be worked.  But, if the function is called so many
times, the problem is occurred.
I found that the IIS is hanged when the code is called "Set
cmd.ActiveConnection = gAdoConn".
I don't know why the problem existed.  The error handler havn't raise
any error in my log file.  So I don't know what is the error.
I hope someone can help me to solve this problem.  Thanks.


Public gAdoConn as New ADODB.Connection
Public gConnString As String                ' connection string

Class Modules: clsPublic.cls
Public Function ConnectDB(ByVal strInConnString As String) As
String 'Pass-In    : Connect information
On Error GoTo errhandler

    Dim RetFun As String

    gConnString =
strInConnString      ' "DSN=abcDB;UID=abc;PWD=123;"     Set gAdoConn =
New ADODB.Connection
    gAdoConn.ConnectionString = gConnString
    gAdoConn.CursorLocation = adUseClient

    If Err Then
        ConnectDB = ERRD_098
        ConnectDB = "0"
    End If

End Function

Public Function Call_SP_Oper(ByVal strSPName As String, _
                            ByRef colOutPara As Collection, _
                            Optional ByVal blnWithPara As Boolean =
False, _
                            Optional ByVal colInPara As Collection) As

On Error GoTo errhandler

    Dim cmd As ADODB.Command
    Dim intCount As Integer, maxCount As Integer
    Dim strPName As String, strTmp As String

    Dim RetFun As String

    ' check the db connection
    If gAdoConn.State <> adStateOpen Then
        RetFun = ConnectDB(gConnString)
        If RetFun <> "0" Then
            Err.Number = ERRN_001
            Err.Description = ERRD_001
            Err.Raise Err.Number
        End If
    End If

    ' Set up a command object for sp
    Set cmd = New ADODB.Command

    cmd.CommandText = strSPName
    cmd.CommandType = adCmdStoredProc

    Set cmd.ActiveConnection = gAdoConn  '  <====

    maxCount = cmd.Parameters.Count
    strTmp = ""
    If blnWithPara Then
        For intCount = 1 To colInPara.Count
            cmd.Parameters.Item(intCount - 1) = CStr(colInPara.Item
            strTmp = strTmp & CStr(colInPara.Item(intCount))
& "; "         Next
    End If

    ' get output parameter
    Set colOutPara = New Collection
    For intCount = 0 To cmd.Parameters.Count - 1

        colOutPara.Add CStr(Format(cmd.Parameters.Item

    Set cmd = Nothing
    If Err Then
        Call DllLog("Call_SP_Oper:" & strSPName, CStr(Err.Number),
        Call_SP_Oper = ERRD_098
        Call_SP_Oper = "0"
    End If
End Function

Class Modules: clsRegister.cls
Public Function Register(ByVal strFamilyName As String, ByVal
strFirstName As String, ByVal strEmailAddr As String, _
                        ByVal strCountryID As String, ByVal
strMembershipId As String, ByVal strPasswd As String, _
                        ByVal strPasswdQue As String, ByVal
strPasswdAns As String) As Integer

On Error GoTo errhandler

    Dim objPublic As New clsPublic
    Dim RetVal As Integer, i As Integer
    Dim RetFun As String, strActkey As String
    Dim colCode As New Collection
    Dim colOutPara As New Collection, colInPara As New Collection

    colInPara.Add CStr(Trim(strFamilyName))
    colInPara.Add CStr(Trim(strFirstName))
    colInPara.Add CStr(Trim(strEmailAddr))
    colInPara.Add CStr(Trim(strCountryID))
    colInPara.Add CStr(Trim(strMembershipId))
    colInPara.Add CStr(Trim(strPasswd))
    colInPara.Add CStr(Trim(strPasswdQue))
    colInPara.Add CStr(Trim(strPasswdAns))

    RetFun = objPublic.Call_SP_Oper(SP_REGISTERUSER, colOutPara, True,
    RetVal = ERRN_099
    If colOutPara.Count >= 10 Then
        RetVal = Val(colOutPara.Item(9))
    End If

    If RetVal = 0 Then
        If RetFun <> "0" Then
            Err.Number = ERRN_002
            Err.Raise Err.Number
        End If
        Err.Number = RetVal
        Err.Raise Err.Number
    End If

    Set objPublic = Nothing
    If Err Then
        Register = Err.Number
        Register = "0"
    End If

End Function

    set objDLL=server.createobject("prj.clsRegister")
    blnText=objDLL.Register(request.form("familyName"), request.form
("FirstName"), request.form("EmailAdd"), request.form("Country"),
request.form("MemberType"), request.form("pwd"), request.form
("quePwd"), request.form("ansPwd"))
    set objDLL=nothing

Sent via http://www.*-*-*.com/
Before you buy.

Sun, 02 Feb 2003 09:29:37 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Error occurred while registrating EXPSRV.DLL USING VB 6.0 setup wizard

2. Resume without error - message when calling ActX DLL from ASP

3. Passing a ADODB.RecordSet from ASP into a VB Active-X DLL

4. Error Occurred in ASP Reports Server?

5. Next Problem - Error 80040E21 "Error Occurred."

6. vb+Oracle error message-Fatal Two-Task

7. HELP: Strange error message, Oracle 7.2, DAO, VB 6.0



10. DLL stays in memory after error occurs in program

11. Error occur in call DLL

12. Active Messaging 1.1--DeliverNow with Remote Connection


Powered by phpBB® Forum Software