get affected record count via ODBC and ADO
rc = ::SQLExecDirect(sql_stmt,(SQLCHAR*)(const
char*)sqlcmds,strlen(sqlcmds));
SQLLEN rowcount = 0;
rc = ::SQLRowCount(sql_stmt,&rowcount);
_bstr_t bstrEmpty;
Conn1.CreateInstance( __uuidof( ADODB::Connection ) );
Conn1->ConnectionString = bstrConnect;
Conn1->Open( bstrConnect, bstrEmpty, bstrEmpty, -1 );
_variant_t records_affected;
Conn1->Execute((LPCTSTR)sqlcmds,&records_affected,0);//VT_I4,lVal
char*)sqlcmds,strlen(sqlcmds));
SQLLEN rowcount = 0;
rc = ::SQLRowCount(sql_stmt,&rowcount);
_bstr_t bstrEmpty;
Conn1.CreateInstance( __uuidof( ADODB::Connection ) );
Conn1->ConnectionString = bstrConnect;
Conn1->Open( bstrConnect, bstrEmpty, bstrEmpty, -1 );
_variant_t records_affected;
Conn1->Execute((LPCTSTR)sqlcmds,&records_affected,0);//VT_I4,lVal
0 Comments:
Post a Comment
<< Home