|
-
August 13th, 2001, 09:04 PM
#1
Count record aside from Recordcount
How can I have record count without using RecordCount function. Is there a way like
Select Count(*) from Tablename
If there is..how can I code this?
starting with
Dim RS As ADODB.Recordset
Set RS = new ADODB.Recordset
RS.Open ....
cecile
The more u read, the more u do not know
-
August 13th, 2001, 09:44 PM
#2
Re: Count record aside from Recordcount
Dim RS As ADODB.Recordset
Set RS = new ADODB.Recordset
RS.Open "SELECT COUNT(*) as RecordCount FROM TableName",cnYourConnection, adOpenKeyset, adLockOptimistic, adCmdText
debug.print RS!RecordCount
rs.close
set rs = nothing
David Paulson
-
August 17th, 2001, 04:47 PM
#3
Re: Count record aside from Recordcount
If you want to use the "select count(*) from Tablename" method, just set a variable to the result like this:
lngCount = RS.Fields(0)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|