Stored procedure won't return to VB

Posted on 2006-03-31
Medium Priority
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.
Question by:caracalla
  • 2
LVL 34

Expert Comment

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

LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 16340980
I assume all you need to do is to add the following line to the procedure:

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

Author Comment

ID: 16341702
found it: SET NOCOUNT ON

There were 2 sets of select statements.
LVL 143

Accepted Solution

Guy Hengel [angelIII / a3] earned 2000 total points
ID: 16341719
>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


Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question