Welcome to dbForumz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

No records returned from SQL stored proc

 
   Database Forums (Home) -> Visual Basic -> ADO RSS
Next:  Can subscriber know the results of Merge rep?  
Author Message
Earl2

External


Since: Jun 14, 2004
Posts: 77



(Msg. 1) Posted: Fri Sep 23, 2005 5:48 pm
Post subject: No records returned from SQL stored proc
Archived from groups: microsoft>public>vb>database>ado (more info?)

Transitioning an app from VB6/JET to VB6/SQL2k. The previous JET code
returns 3 records but the new code returns 0 from the same table. The new
code:

Public Db As New ADODB.Connection
Public strCN As String

Set Db = New Connection

strCN = "Provider=sqloledb;" & _
"Data Source=Earl-XPPRO;" & _
"Initial Catalog=ImprovementPricing2005;" & _
"Integrated Security=SSPI"

Db.Open strCN

cmd.ActiveConnection = Db
cmd.CommandText = "sel_ActiveProspects"
cmd.CommandType = adCmdStoredProc

Set rsC = cmd.Execute

'should have 3 records here, getting -1 for recordcount
'but the connection state shows open and the recordset state shows open

The stored procedure executes in QA and returns the 3 records (dropped the
WHERE for now):

CREATE PROCEDURE sel_ActiveProspects
AS
SELECT Phone,Salutation,FirstName as [First Name],LastName as [Last Name],
Address,City,State,Zip,CustomerID
FROM JobProspects

 >> Stay informed about: No records returned from SQL stored proc 
Back to top
Login to vote
Earl2

External


Since: Jun 14, 2004
Posts: 77



(Msg. 2) Posted: Fri Sep 23, 2005 8:02 pm
Post subject: Re: Records ARE returned from SQL stored proc but [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hmmmm ... well, I *am* getting a recordcount of 3, but with the new
provider, the recordset.recordcount is returning the -1, apparently
rejecting the cursor type set even if I open it like so:

rsC.Open cmd, , adOpenStatic, adLockOptimistic

The net effect of this is to prevent me from binding the recordset to an
Ultragrid. I'm getting the message, "Provider does not support minimum
binding requirements".

"Earl" wrote in message

> Transitioning an app from VB6/JET to VB6/SQL2k. The previous JET code
> returns 3 records but the new code returns 0 from the same table. The new
> code:
>
> Public Db As New ADODB.Connection
> Public strCN As String
>
> Set Db = New Connection
>
> strCN = "Provider=sqloledb;" & _
> "Data Source=Earl-XPPRO;" & _
> "Initial Catalog=ImprovementPricing2005;" & _
> "Integrated Security=SSPI"
>
> Db.Open strCN
>
> cmd.ActiveConnection = Db
> cmd.CommandText = "sel_ActiveProspects"
> cmd.CommandType = adCmdStoredProc
>
> Set rsC = cmd.Execute
>
> 'should have 3 records here, getting -1 for recordcount
> 'but the connection state shows open and the recordset state shows open
>
> The stored procedure executes in QA and returns the 3 records (dropped the
> WHERE for now):
>
> CREATE PROCEDURE sel_ActiveProspects
> AS
> SELECT Phone,Salutation,FirstName as [First Name],LastName as [Last Name],
> Address,City,State,Zip,CustomerID
> FROM JobProspects
>
>
>
>
>

 >> Stay informed about: No records returned from SQL stored proc 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Disconnected RS, FK constraint, errors returned - I would appreciate any ideas on this. I have 2 disconnected recordsets. At the db, these refer directly to tables 1 and 2. Table 2 has a primary key matching Table 1 and a foreign key set up for delete and update cascades against the same primary key....

resorting recordset returned from SQL stroed procedure - I have a stored procedure on a SQL server 2005 database. Application accessing it is a VB6 program. The app returns the records fine. What I would llike to do is after the recordset gets returned is to resort it to one of the columns returned. Data is..

Adding records via datasheet - Hi, I am trying to add records to a disconnected ADODB recordset via a datasheet. I created a record set, added fields, populated it with data, and bound the fields in my datasheet to the fields in the recordset. When I navigate to the empty row at th...

Most efficient way to process this set of records??? - Hello All, I'd like to know the most efficient way to process a set of records. I've built a composite record that is to contain columns from 6 other "Master" tables. I need to update the composite record with the values of those columns and...

Delete records in EXCEL using ADO - Hi, All, I created a small tool using VB6, in which I needed to insert some data from Sybase database into an EXCEL file. I use an EXCEL template file with only one row which will be recognized as each column name when connected using ADO. It's...
   Database Forums (Home) -> Visual Basic -> ADO All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]