Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Adodc - RecordSet - Record Count?

324 views
Skip to first unread message

Walter

unread,
Mar 13, 2003, 4:49:53 PM3/13/03
to
Does anyone know how to get Adodc to return the number of records in
the selected recordset. If there are 80 records - how do I pull that
information.

I tried a simple Text1 = Adodc.RecordCount (doesn't work)

any ideas?

Thanks in advance............ Walter

Martin

unread,
Mar 13, 2003, 9:19:40 PM3/13/03
to
.RecordCount is a property of a RecordSet. So, do whatever you do to
create your recordset, then, before you look at the RecordCount
property, do a .MoveLast. This populates the recordset. The
RecordCount should then contain the count you're looking for.

HTH

On 13 Mar 2003 13:49:53 -0800, groups.9...@spamgourmet.com

Barry Kimelman

unread,
Mar 14, 2003, 9:07:02 AM3/14/03
to

In article <5dd4cbad.03031...@posting.google.com>, Walter
(groups.9...@spamgourmet.com) says...

Here is some code extracted from one of my VB6 programs


Dim myConnection As ADODB.Connection
Dim myRecordSet As ADODB.Recordset
Dim strSQL As String
Dim sqlCount As Integer

strSQL = "SELECT * FROM mytable";

Set myConnection = New ADODB.Connection

myConnection.ConnectionString =
"Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;User
ID=Admin;Data Source=" & m_strDatabaseFile & ";Mode=Share Deny None"
myConnection.CursorLocation = adUseClient

myConnection.Open

' Create a Recordset by executing a SQL statement
Set myRecordSet = myConnection.Execute(strSQL)

If myRecordSet.EOF = True Then
myRecordSet.Close
myConnection.Close
Exit Function
End If

' Get record count
sqlCount = myRecordSet.RecordCount


--
---------

Barry Kimelman
Winnipeg, Manitoba, Canada
email : bkim...@hotmail.com

Clyde Davis

unread,
Mar 15, 2003, 7:18:08 PM3/15/03
to
If ADODC was the recordset name we are all in trouble. If it wasn't try
rs.recordcount
Where rs is the variable containing the recordset name


0 new messages