Stored procedure won't return to VB

Posted on 2006-03-31
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
    LVL 34

    Expert Comment

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

    LVL 142

    Expert Comment

    by:Guy Hengel [angelIII / a3]
    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

    found it: SET NOCOUNT ON

    There were 2 sets of select statements.
    LVL 142

    Accepted Solution

    >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


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Introduction In a recent article ( for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
    Introduction While answering a recent question ( 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…
    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…

    737 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

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now