|
-
Jul 8th, 2004, 06:59 PM
#1
Thread Starter
Member
record number
How can I get a record number from any table or query in SQL Server through ADO recordset, but CursorLocation in server side. There are some way to know it?
-
Jul 8th, 2004, 08:32 PM
#2
Banned
Do you mean record count (total number of records) or the position of current record of your server-side cursor? Here is the answer to both:
Code:
'Record Count
If rsSCIROCCO.Supports(adApproxPosition) Or rsSCIROCCO.Supports(adBookmark) Then
RecordCount = rsSCIROCCO.RecordCount
End If
Code:
'Current Position
If rsSCIROCCO.Supports(adApproxPosition) Then
AbsolutePosition = rsSCIROCCO.AbsolutePosition
End If
-
Jul 9th, 2004, 06:40 AM
#3
Fanatic Member
If the recordset is forward only you can use the following to get a recordcount
VB Code:
Dim rs As New ADODB.Recordset
Dim vCount() As Variant
Dim lCount As Long
rs.Open “SELECT * FROM Test”, “DSN=Test”, , , adCmdText
vCount() = rs.GetRows()
lCount = UBound(vCount, 2) + 1
Debug.Print lCount
Hope this helps
Useful Links
.Net
#Develop, GhostDoc, CodeKeep , be.PINVOKE, Good Code Snippet Site
Krypton Toolkit, XPCC / XP Common Controls, QSS Windows Forms Components
VB.COM
VB.Classic Help File, MB Controls, MZTools, ADO Stored Procedure Generator add-in,
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
|