ExecProcedure in Lotus Script

LYekelchik2007 used Ask the Experts™
hi ..
I am using the foolwing script
Dim session As New NotesSession
      Dim db As NotesDatabase
      Dim con As New ODBCConnection
      Dim qry As New ODBCQuery
      Dim result As New ODBCResultSet
      Dim status As Variant
      Dim sqlString As String      
      Dim doc As NotesDocument
      Dim W As New NotesUIWorkspace    
      Dim UIDoc As NotesUIDocument
      Set UIDoc = W.CurrentDocument
      Set doc = UIDoc.Document    
      sLeadID = doc.LeadID(0)
      Set db = session.CurrentDatabase
      Set qry.Connection = con
      Set result.Query = qry
      Call  DbConnect(con)
      If con.DataSourceName <> "" Then status = True
      Set result.Connection = con
      Call  result.ExecProcedure("PROC_HOPGetApplicationNextNumber","'sLeadID'")

      TT  = result.GetValue(1)
      TT2  = result.GetValue(2)
      Messagebox TT2,, "Value of first row"

question.. ?
Can we check result after ExecProcedure
Call  result.ExecProcedure("PROC_HOPGetApplicationNextNumber","'sLeadID'")
how script will be check result ?

Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Sjef BosmanGroupware Consultant

Maybe you need some error checking, like this:

      Dim ok As Integer
      ok= False
      On Error Goto errorlabel
      Call  result.ExecProcedure("PROC_HOPGetApplicationNextNumber","'sLeadID'")
      ok= True
      If ok Then
      End If
      Exit Sub
      Resume ok ' ok is still False!



The reason return only False for me and never True ... I am not sure , if  "Call  result.ExecProcedure" working at all ..
Groupware Consultant
And you also tried with
      status= result.ExecProcedure("PROC_HOPGetApplicationNextNumber","'sLeadID'")
      MsgBox Cstr(status)

Did you try to run your code in the debugger, line by line?

You might also add a line after the errorlabel
      MsgBox "Error " & Err & " on line " & Erl & ": " & Error$

What version of Notes?  What version of SQL?

IN R4 and R5 the execProcedure may not work with certain version of SQL.  See:

The link provides an alternative way to call the procedure that you may try.   Also, check the SQL log to see if any errors appear there.

No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I will leave the following recommendation for this question in the Cleanup Zone:
 Split: sjef_bosman {19187577} & marilyng {19202726}

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

Experts Exchange Cleanup Volunteer

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial