This is my Com component
cCriteria
Option Explicit
'Implements iCriteria
Private cn As ADODB.Connection
Public Function GetCriteria(BYVAL strsql As String) As ADODB.Recordset
On Error GoTo PROC_ERR
Dim rs As ADODB.Recordset
Dim cmd As ADODB.Command
cn.CursorLocation = adUseClient
Set cmd = CreateObject("ADODB.Command"
cmd.CommandType = adCmdText
cmd.CommandText = strsql
cmd.ActiveConnection = cn
Set rs = CreateObject("ADODB.Recordset"
'rs.CursorLocation = adUseClient
rs.CursorType = adOpenForwardOnly
Set rs = cmd.Execute
Set GetCriteria = rs
PROC_EXIT:
Set rs = Nothing
Set cmd = Nothing
Exit Function
PROC_ERR:
Debug.Print Err.Description
App.StartLogging App.Path & "\error.log", vbLogToFile
App.LogEvent Err.Description, vbLogEventTypeError
Resume PROC_EXIT
End Function
I compile the component and install it onto my MTS server.Createa
package
and export it. and install the component on my system Now I try to use it In my client app
Public SelectObj As WalmartServer.cCriteria
Set SelectObj = CreateObject("WalmartServer.cCriteria"
Set rsClient = SelectObj.GetCriteria(strSQL)
I get the Following error on this Statement
Set rsClient = SelectObj.GetCriteria(strSQL)
Automation Variable used not supported by Visual Basic.
OR
Method 'GetCriteria' of object '_cCriteria' failed
This problem only comes when I try to install the component and try to
run
the app,....but everything is fine in the debug mode...Like running the
whole app as a group.
Reply as soon as possible will be appreciated....If you have anymore
questions , I will be happy to answer them
cCriteria
Option Explicit
'Implements iCriteria
Private cn As ADODB.Connection
Public Function GetCriteria(BYVAL strsql As String) As ADODB.Recordset
On Error GoTo PROC_ERR
Dim rs As ADODB.Recordset
Dim cmd As ADODB.Command
cn.CursorLocation = adUseClient
Set cmd = CreateObject("ADODB.Command"
cmd.CommandType = adCmdText
cmd.CommandText = strsql
cmd.ActiveConnection = cn
Set rs = CreateObject("ADODB.Recordset"
'rs.CursorLocation = adUseClient
rs.CursorType = adOpenForwardOnly
Set rs = cmd.Execute
Set GetCriteria = rs
PROC_EXIT:
Set rs = Nothing
Set cmd = Nothing
Exit Function
PROC_ERR:
Debug.Print Err.Description
App.StartLogging App.Path & "\error.log", vbLogToFile
App.LogEvent Err.Description, vbLogEventTypeError
Resume PROC_EXIT
End Function
I compile the component and install it onto my MTS server.Createa
package
and export it. and install the component on my system Now I try to use it In my client app
Public SelectObj As WalmartServer.cCriteria
Set SelectObj = CreateObject("WalmartServer.cCriteria"
Set rsClient = SelectObj.GetCriteria(strSQL)
I get the Following error on this Statement
Set rsClient = SelectObj.GetCriteria(strSQL)
Automation Variable used not supported by Visual Basic.
OR
Method 'GetCriteria' of object '_cCriteria' failed
This problem only comes when I try to install the component and try to
run
the app,....but everything is fine in the debug mode...Like running the
whole app as a group.
Reply as soon as possible will be appreciated....If you have anymore
questions , I will be happy to answer them