CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 1999
    Posts
    40

    SQLBindParameter

    I am having trouble with the following code (the sp follows). The error (e->m_strError) returns is "COUNT field incorrect". I am not sure what I am doing wrong. Any thoughts would be greatly appreciated.


    SQLHSTMT hstmt = SQL_NULL_HSTMT;
    RETCODE nRetCode;
    long test;
    long testlength=sizeof(test);
    nRetCode=::SQLBindParameter(hstmt,1,SQL_PARAM_OUTPUT,SQL_C_LONG,SQL_INTEGER,0,0,&test,0,&testlength);
    m_App->m_strSQL="{Call spTest(?)}";
    try{
    m_App->m_Database->ExecuteSQL(m_App->m_strSQL);
    }
    catch (CDBException* e){
    AfxMessageBox(e->m_strError,MB_OK | MB_ICONINFORMATION);
    e->Delete();
    return;
    }

    create procedure spTest
    @record int output
    as
    select @record=123456


  2. #2
    Join Date
    May 1999
    Posts
    3,332

    Re: SQLBindParameter

    I'd rather override the BindParameters method of the CDatabase object and do the SQLBindParameter there.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured