Skip to Content
author's profile photo Former Member
Former Member

Recordset.Command.Execute within Item Validate event not working

We are trying to execute a stored procedure to return five records to a recordset.

In VB debug mode the very first execute does not return anything, however retrying the execute (from the debug window ) does return the records.

can anyone suggest a way to invoke the command.execute from within the item validate event please?

Thanks,

Indika

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Dec 14, 2004 at 04:58 AM

    Hi I am also having difficulty getting a stored procedure to execute...

    How do you execute the command object??

    I have tried creating a recordset and executing the command object through it to no avail...

    Here is basically what i want to do (c#):

    SAPbobsCOM.Recordset rs = (SAPbobsCOM.Recordset)pCmp.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset);

    rs.Command.Name = "MyStoredProcName";

    rs.Command.Execute();

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Ibai Peña

      Hi Ibai,

      Once again thanks for you reply!

      I tried the code again and it worked without the "Exec", the problem was that the stored proc was expecting a parameter, which I was setting as:

      rs.Command.Parameters.Item(0).Value = "paramvalue";

      however, I later found out that 0 seems to be reserved for SBO's default out parameter, so when i set it to 1:

      rs.Command.Parameters.Item(1).Value = "paramvalue";

      everything worked fine!

      (The parameter collection is populated once the command name has been set.)

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.