mohan86
July 30th, 2000, 10:58 PM
A stored procedure is executed from the Bussines object report through VB.
This procedure is executed successfully when run from the sqlplus. But, when
triggered from VB, it results in an error. For the error message, please
look at the 'Error'below.The VB code which triggers the procedure
is in the'VBCode' given below. The stored procedure is usage.spp.txt
Error:
run-time error '2147217871(80040e31)'
ORA-01013:user requested cancel of current operation.
vb code:
Option Explicit
Dim bill_cycle_param As ADODB.Parameter
Dim bill_cycle_end_Date_param As ADODB.Parameter
Dim return_param As ADODB.Parameter
Dim conxn As ADODB.Connection
Dim strconxn As String
Dim procname As String
Dim cmdpack As ADODB.Command
Dim bill_cycle_rs As ADODB.Recordset
Dim bill_cycle_query_txt As String
Private Sub Cancel_cmnd_Click()
Loading_status_form.Hide
End Sub
Private Sub Package_cmnd_Click()
Set cmdpack = New ADODB.Command
procname = "usage.proc_reconcile"
cmdpack.CommandText = procname
cmdpack.CommandType = adCmdStoredProc
Set cmdpack.ActiveConnection = conxn
Set bill_cycle_end_Date_param = cmdpack.CreateParameter("Bill Cycle End Date", adInteger, adParamInput, 8, Right(bill_cycle_cmbo.value, 8))
cmdpack.Parameters.Append bill_cycle_end_Date_param
Set bill_cycle_param = cmdpack.CreateParameter("Bill Cycle", adChar, adParamInput, 2, Left(bill_cycle_cmbo.value, 2))
cmdpack.Parameters.Append bill_cycle_param
cmdpack.Execute
MsgBox "Procedure " & procname & " completed successfully."
Loading_status_form.Hide
End Sub
Private Sub UserForm_Activate()
strconxn = "DSN=RECLD;UID=u929635;PWD=proximus"
Set conxn = New ADODB.Connection
conxn.Open strconxn
Set bill_cycle_rs = New ADODB.Recordset
bill_cycle_rs.ActiveConnection = conxn
bill_cycle_query_txt = "select distinct bill_cycle, bill_cycle_end_date from recl.rec_ref_Days"
bill_cycle_rs.Open bill_cycle_query_txt
If bill_cycle_rs.EOF Then
MsgBox "No entries for the number of Calendar days and Business days"
Package_cmnd.Enabled = False
Cancel_cmnd.SetFocus
Else
If Not bill_cycle_rs.BOF Then
'bill_cycle_rs.MoveFirst
While Not bill_cycle_rs.EOF
bill_cycle_cmbo.AddItem bill_cycle_rs.Fields("bill_cycle").value & "," & bill_cycle_rs.Fields("bill_cycle_end_date").value
bill_cycle_rs.MoveNext
Wend
End If
End If
bill_cycle_rs.Close
bill_cycle_cmbo.ListIndex = 0
End Sub
This procedure is executed successfully when run from the sqlplus. But, when
triggered from VB, it results in an error. For the error message, please
look at the 'Error'below.The VB code which triggers the procedure
is in the'VBCode' given below. The stored procedure is usage.spp.txt
Error:
run-time error '2147217871(80040e31)'
ORA-01013:user requested cancel of current operation.
vb code:
Option Explicit
Dim bill_cycle_param As ADODB.Parameter
Dim bill_cycle_end_Date_param As ADODB.Parameter
Dim return_param As ADODB.Parameter
Dim conxn As ADODB.Connection
Dim strconxn As String
Dim procname As String
Dim cmdpack As ADODB.Command
Dim bill_cycle_rs As ADODB.Recordset
Dim bill_cycle_query_txt As String
Private Sub Cancel_cmnd_Click()
Loading_status_form.Hide
End Sub
Private Sub Package_cmnd_Click()
Set cmdpack = New ADODB.Command
procname = "usage.proc_reconcile"
cmdpack.CommandText = procname
cmdpack.CommandType = adCmdStoredProc
Set cmdpack.ActiveConnection = conxn
Set bill_cycle_end_Date_param = cmdpack.CreateParameter("Bill Cycle End Date", adInteger, adParamInput, 8, Right(bill_cycle_cmbo.value, 8))
cmdpack.Parameters.Append bill_cycle_end_Date_param
Set bill_cycle_param = cmdpack.CreateParameter("Bill Cycle", adChar, adParamInput, 2, Left(bill_cycle_cmbo.value, 2))
cmdpack.Parameters.Append bill_cycle_param
cmdpack.Execute
MsgBox "Procedure " & procname & " completed successfully."
Loading_status_form.Hide
End Sub
Private Sub UserForm_Activate()
strconxn = "DSN=RECLD;UID=u929635;PWD=proximus"
Set conxn = New ADODB.Connection
conxn.Open strconxn
Set bill_cycle_rs = New ADODB.Recordset
bill_cycle_rs.ActiveConnection = conxn
bill_cycle_query_txt = "select distinct bill_cycle, bill_cycle_end_date from recl.rec_ref_Days"
bill_cycle_rs.Open bill_cycle_query_txt
If bill_cycle_rs.EOF Then
MsgBox "No entries for the number of Calendar days and Business days"
Package_cmnd.Enabled = False
Cancel_cmnd.SetFocus
Else
If Not bill_cycle_rs.BOF Then
'bill_cycle_rs.MoveFirst
While Not bill_cycle_rs.EOF
bill_cycle_cmbo.AddItem bill_cycle_rs.Fields("bill_cycle").value & "," & bill_cycle_rs.Fields("bill_cycle_end_date").value
bill_cycle_rs.MoveNext
Wend
End If
End If
bill_cycle_rs.Close
bill_cycle_cmbo.ListIndex = 0
End Sub