Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stored procedure works in ODBC but not in OLE DB

Status
Not open for further replies.

szfq93

Programmer
Jul 12, 2002
11
US
We have a complex stored procedure that aggregates data (uses a group by clause, among many other things). This query, when run in the SQL Query Analyzer, returns the following SQL Server warning:

Null value is eliminated by an aggregate or other SET operation

But, it still returns the data after this statement.
When I call the stored procedure from VB code, it works okay with ODBC (OLE DB for ODBC provider). But, the exact same call, the exact same code, fails (the recordset remains closed) when I use OLE DB.

Any advice would be appreciated!
 
Hi,

Wht is the error message u r getting........ can u post the code u r using.......


Sunil
 
It sounds crazy, but I have had procedures that needed
"SET NOCOUNT ON" to make them work. They were fine in Query Analyzer, but OLEDB would fail.

 
As a rule, we ALWAYS use SET NOCOUNT ON (except where counting is needed). So, my stored procedure already has it set.

For now, I went ahead and SET ANSI_WARNINGS OFF and that took care of the problem.

Thanks for your help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top