Avatar billede macpain Nybegynder
19. februar 2007 - 11:46 Der er 1 løsning

Find ? fejl ved SQLExecDirect

Jeg er gået hen og har stirreret mig blind på nedenstående....hvor er fejlen/fejlene(får -1 ved sidste linie):

string str =
  "{ call Booking(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) }";
 
  if (m_sr == SQL_SUCCESS || m_sr == SQL_SUCCESS_WITH_INFO)
  {
    //@pDateOfBirth
    m_sr = SQLBindParameter(m_stmtHandle, 1, SQL_PARAM_INPUT, SQL_C_CHAR,  SQL_CHAR, VARCHAR_254,
                                          0, row.dateOfBirth, sizeof(row.dateOfBirth), SQL_NULL_HANDLE);
    //@pClientName
    m_sr = SQLBindParameter(m_stmtHandle, 2, SQL_PARAM_INPUT, SQL_C_CHAR,  SQL_CHAR, VARCHAR_100,
                                          0, row.clientName,  sizeof(row.clientName), SQL_NULL_HANDLE);
    //@pOrderNo
    m_sr = SQLBindParameter(m_stmtHandle, 3, SQL_PARAM_INPUT, SQL_C_SLONG,  SQL_INTEGER, 0,
                                          0, &row.orderId, 0, SQL_NULL_HANDLE);
    //@pNumSpaces
    m_sr = SQLBindParameter(m_stmtHandle, 4, SQL_PARAM_INPUT, SQL_C_SLONG,  SQL_INTEGER, 0,
                                          0, &row.numberOfSeats, 0, SQL_NULL_HANDLE);
    //@pSpaceType
    m_sr = SQLBindParameter(m_stmtHandle, 5, SQL_PARAM_INPUT, SQL_C_CHAR,  SQL_CHAR, VARCHAR_100,
                                          0, row.seatType,    sizeof(row.seatType), SQL_NULL_HANDLE);
//Pickup

    //@pPUSubOrderNo
    m_sr = SQLBindParameter(m_stmtHandle, 6, SQL_PARAM_INPUT, SQL_C_SLONG,  SQL_INTEGER, 0,
                                          0, &row.pickupOrderNo, 0, SQL_NULL_HANDLE);
    //@pPUTime
    m_sr = SQLBindParameter(m_stmtHandle, 7, SQL_PARAM_INPUT, SQL_C_CHAR,  SQL_CHAR, VARCHAR_20,
                                          0, row.pickupTime,    sizeof(row.pickupTime), SQL_NULL_HANDLE);
    //@pPUAddrName
    m_sr = SQLBindParameter(m_stmtHandle, 8, SQL_PARAM_INPUT, SQL_C_CHAR,  SQL_CHAR, VARCHAR_254,
                                          0, row.pickupAddressName, sizeof(row.pickupAddressName), SQL_NULL_HANDLE);
    //@pPUOnStreet
    m_sr = SQLBindParameter(m_stmtHandle, 9, SQL_PARAM_INPUT, SQL_C_CHAR,  SQL_CHAR, VARCHAR_254,
                                          0, row.pickupStreet,  sizeof(row.pickupStreet), SQL_NULL_HANDLE);
    //@pPUStreetNo
    m_sr = SQLBindParameter(m_stmtHandle, 10, SQL_PARAM_INPUT, SQL_C_CHAR,  SQL_CHAR, VARCHAR_20,
                                          0, row.pickupStreetNo, sizeof(row.pickupStreetNo), SQL_NULL_HANDLE);
    //@pPUZipCode
    m_sr = SQLBindParameter(m_stmtHandle, 11, SQL_PARAM_INPUT, SQL_C_CHAR,  SQL_CHAR, VARCHAR_20,
                                          0, row.pickupZipCode, sizeof(row.pickupZipCode), SQL_NULL_HANDLE);
    //@pPUCity
    m_sr = SQLBindParameter(m_stmtHandle, 12, SQL_PARAM_INPUT, SQL_C_CHAR,  SQL_CHAR, VARCHAR_254,
                                          0, row.pickupLocation, sizeof(row.pickupLocation), SQL_NULL_HANDLE);
    //@pPUPhone
    m_sr = SQLBindParameter(m_stmtHandle, 13, SQL_PARAM_INPUT, SQL_C_CHAR,  SQL_CHAR, VARCHAR_100,
                                          0, row.pickupPhoneNumber, sizeof(row.pickupPhoneNumber), SQL_NULL_HANDLE);
    //@pPUAddrComments
    m_sr = SQLBindParameter(m_stmtHandle, 14, SQL_PARAM_INPUT, SQL_C_CHAR,  SQL_CHAR, VARCHAR_254,
                                          0, row.pickupAddressComment, sizeof(row.pickupAddressComment), SQL_NULL_HANDLE);
    //@pPUCliComments
    m_sr = SQLBindParameter(m_stmtHandle, 15, SQL_PARAM_INPUT, SQL_C_CHAR,  SQL_CHAR, VARCHAR_254,
                                          0, row.pickupComment, sizeof(row.pickupComment), SQL_NULL_HANDLE);
//deliver

    //@pDOTime
    m_sr = SQLBindParameter(m_stmtHandle, 16, SQL_PARAM_INPUT, SQL_C_CHAR,  SQL_CHAR, VARCHAR_20,
                                          0, row.deliverTime, sizeof(row.deliverTime), SQL_NULL_HANDLE);
    //@pDOAddrName
    m_sr = SQLBindParameter(m_stmtHandle, 17, SQL_PARAM_INPUT, SQL_C_CHAR,  SQL_CHAR, VARCHAR_254,
                                          0, row.deliverAddressName, sizeof(row.deliverAddressName), SQL_NULL_HANDLE);
    //@pDOOnStreet
    m_sr = SQLBindParameter(m_stmtHandle, 18, SQL_PARAM_INPUT, SQL_C_CHAR,  SQL_CHAR, VARCHAR_254,
                                          0, row.deliverStreet, sizeof(row.deliverStreet), SQL_NULL_HANDLE);
    //@pDOStreetNo
    m_sr = SQLBindParameter(m_stmtHandle, 19, SQL_PARAM_INPUT, SQL_C_CHAR,  SQL_CHAR, VARCHAR_20,
                                          0, row.deliverStreetNo, sizeof(row.deliverStreetNo), SQL_NULL_HANDLE);
    //@pDOZipCode
    m_sr = SQLBindParameter(m_stmtHandle, 20, SQL_PARAM_INPUT, SQL_C_CHAR,  SQL_CHAR, VARCHAR_20,
                                          0, row.deliverZipCode, sizeof(row.deliverZipCode), SQL_NULL_HANDLE);
    //@pDOCity
    m_sr = SQLBindParameter(m_stmtHandle, 21, SQL_PARAM_INPUT, SQL_C_CHAR,  SQL_CHAR, VARCHAR_254,
                                          0, row.deliverLocation, sizeof(row.deliverLocation), SQL_NULL_HANDLE);
    //@pDOPhone
    m_sr = SQLBindParameter(m_stmtHandle, 22, SQL_PARAM_INPUT, SQL_C_CHAR,  SQL_CHAR, VARCHAR_100,
                                          0, row.deliverPhoneNumber, sizeof(row.deliverPhoneNumber), SQL_NULL_HANDLE);
    //@pDOAddrComments
    m_sr = SQLBindParameter(m_stmtHandle, 23, SQL_PARAM_INPUT, SQL_C_CHAR,  SQL_CHAR, VARCHAR_254,
                                          0, row.deliverAddressComment, sizeof(row.deliverAddressComment), SQL_NULL_HANDLE);
    //@pDOCliComments
    m_sr = SQLBindParameter(m_stmtHandle, 24, SQL_PARAM_INPUT, SQL_C_CHAR,  SQL_CHAR, VARCHAR_254,
                                          0, row.deliverComment, sizeof(row.deliverComment), SQL_NULL_HANDLE);
  }

  m_sr = SQLExecDirect( m_stmtHandle, (UCHAR*)str.c_str(), SQL_NTS) ;
Avatar billede macpain Nybegynder
19. februar 2007 - 13:52 #1
hrmm, der var ingen fejl - bare forkerte oplysningninger om SP sammensætningen!!
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Computerworld tilbyder specialiserede kurser i database-management

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester