LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Slim Jim

Sorry about preovious post (accidentally hit Send,
posting only half the message !)

Here goes again, hope someone can advise...



I am connecting to a SQL Server stored procedure in Excel
VBA.

However, I am having difficulty COUNTING the number of
records returned from that Stored Procedure.

I have this code...

Dim conDB As New ADODB.Connection
Dim rstSP As New ADODB.Recordset
Dim strConnect As String

strConnect = "driver={sql server};server=
(local);database=mydb;uid=;pwd=;"


With conDB
.ConnectionString = strConnect
.Open
End With

'open the SP into recordset
conDB.storedprocname, rstSP

Now, I need to work out how many records have been
returned from the stored procedure into the recordset...

RecordCount DOES NOT WORK (it always returns -1), and I
need to be able to loop through the recordset but I can't
because I don't know how long it is !!

Please help !!

Cheers


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 04:22 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"