We help IT Professionals succeed at work.

Stored procedure won't return to VB

caracalla
caracalla asked
on
Medium Priority
217 Views
Last Modified: 2010-05-01
VB 6.0; SQL Server 2000

A stored procedure runs perfectly well from SQL Query Analyzer. However, from VB, it won't return anything. If I comment the SQL totally from stored procedure and replace it with 'hello', it returns 'hello' to VB. The parameters are OK.
Comment
Watch Question

Commented:
Can we see some code?  VB and T-SQL would be handy

Dave
Guy Hengel [angelIII / a3]Billing Engineer
CERTIFIED EXPERT
Most Valuable Expert 2014
Top Expert 2009

Commented:
I assume all you need to do is to add the following line to the procedure:

CREATE PROCEDURE yourproc
AS
SET NOCOUNT ON       --- add this line
... here comes the rest of your proc code

Author

Commented:
found it: SET NOCOUNT ON


There were 2 sets of select statements.
Billing Engineer
CERTIFIED EXPERT
Most Valuable Expert 2014
Top Expert 2009
Commented:
>There were 2 sets of select statements.

if you have 2 different select statements, you have to use the ADO's Recordset method .NextRecordset which returns the second (next) recordset

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.