ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Counting records (https://www.excelbanter.com/excel-programming/320600-counting-records.html)

Slim Jim

Counting records
 
Hi there

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


JM[_5_]

Counting records
 
Where is the rest of the code? If you are assigning the return value of the
sp call to a rs, then just get the recordcount property of the rs.



"Slim Jim" wrote in message
...
Hi there

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





All times are GMT +1. The time now is 06:49 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com