Stored procedure/NAV

sukinosukino Member Posts: 6
edited 2012-09-21 in SQL General
I am using NAV 3.7 to execute a stored procedure residing on sql server 2000. The stored procedure executes fine on the sql server, however when I tried to run the report, the error occurs:
This message is for C/AL programmers:

An exception was raised in method Append. The OLE control or Automation server has returned error (HRESULT) -2147352567. The component did not provide the exception description.


lADOParameter:=lADOCommand.CreateParameter('@TemplateID', 200, 1, 20, vTemplateid);
lADOCommand.Parameters.Append(lADOParameter); <-- Error occurs here

The sp requires 2 input parameters (both varchar) and 1 output parameter. The error starts on the first parameter append method.
Appreciate it if someone could advise.

Comments

  • krikikriki Member, Moderator Posts: 9,112
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • sukinosukino Member Posts: 6
    I am using "Compose a SQL String, execute that SQL String and give back the results " as a reference.

    When it failed, I even used the exact copy to test. Same error occurring on the same darn line: lADOCommand.Parameters.Append(lADOParameter);

    Do I need to change any setting from the SQL Server?
  • krikikriki Member, Moderator Posts: 9,112
    sukino wrote:
    Do I need to change any setting from the SQL Server?
    Not that I know of.

    But are you sure that you connected correctly to the server?
    This you can test by doing some select-command on a table.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • sukinosukino Member Posts: 6
    It is fine. It is just that line that is causing me problem.
  • sc00bysc00by Member Posts: 43
    Did anybody find the cause / resolution to this problem?
    I have seen the same message reported by some of the users here but am not entirely sure whether it's permission based or something else.

    Did the OP ever get to the bottom of the issue and if so could the results be posted here for reference purposes please?

    Many Thanks,

    Rob.
    Site uses SQL Server 2005, Client is 4.0SP3 (latest HF), main bulk of code is from 3.60.
  • max_hlmax_hl Member Posts: 13
    I had the same error when compiling object on Win 7 machine and running code on RDP server with Windows 2003.
    But on Win 7 machine all works fine.

    Try to compile object with
    lADOCommand.Parameters.Append(lADOParameter);
    
    on Windows XP or Windows Server 2003 machine.
    In Win 7 perhaps different version of ADO library or it may be after Visual Studio, SQL Server MS or another software installation.
Sign In or Register to comment.