|
Posted by Erland Sommarskog on 05/04/07 21:34
gok (gok@aeromap.com) writes:
> CBindDatabase dbase;
> int rs = dbase.OpenEx( sConnectString, CDatabase::useCursorLib |
> CDatabase::noOdbcDialog );
> this->m_msg.Format("INSERT INTO [dbo].[tTrackLog] (%s) OUTPUT
> inserted.RECID VALUES ('%s')",
> "[WORKSTATION]", "bla");
> dbase.ExecuteSQL(m_msg);
>...
> .cpp:
> void CBindDatabase::BindParameters(HSTMT hstmt)
> {
> RetCode = SQLBindParameter(
> hstmt,
> 1, // Parameter number, ordered sequentially in increasing
> parameter order, starting at 1.
> SQL_PARAM_OUTPUT,// in or out
> SQL_C_SLONG, // value type: SIGNED INTEGER
> SQL_INTEGER, // parameter type: integer
> 0, // column size
> 0, // decimals digits
> &Value, // param value ptr
> 4, // buff length
> &StrLenOrIndPtr); // StrLen_or_IndPtr
> }
But there are no parameters in your SQL batch, and least of all any
output parameters. The OUTPUT clause generates a result set.
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Navigation:
[Reply to this message]
|