Time:09-28
CodePudding user response:
AbsolutePosition sample and CursorLocation attribute This example to explain how the AbsolutePosition attribute to enumerate all you record the circulation process of tracking, it sets the cursor to the client cursor, using CursorLocation activation AbsolutePosition attribute, Public Sub AbsolutePositionX () Dim rstEmployees As ADODB. You Dim strCnn As String Dim strMessage As String 'using client-side cursor table for employee opens a recordset, StrCnn="Provider=sqloledb;" & _ "Data Source=the SRV; Initial Catalog=pubs; User Id=sa; Password=; "The Set rstEmployees=New ADODB. You 'using client-side cursor activation AbsolutePosition properties, RstEmployees. CursorLocation=adUseClient RstEmployees. Open "employee," strCnn,,, adCmdTable 'enumeration recordset, The Do While Not rstEmployees. EOF 'display the current record information, StrMessage="Employee:" & amp; RstEmployees! LName & amp; VbCr & amp; _ "(record" & amp; RstEmployees. AbsolutePosition & amp; _ "Of" & amp; RstEmployees. RecordCount & amp; ")"If MsgBox (strMessage vbOKCancel)=vbCancel _ Then the Exit Do RstEmployees. MoveNext Loop RstEmployees. Close End Sub
Public Sub AbsolutePositionX () Dim rstEmployees As ADODB. You Dim strCnn As String Dim strMessage As String 'using client-side cursor table for employee opens a recordset, StrCnn="Provider=sqloledb;" & _ "Data Source=the SRV; Initial Catalog=pubs; User Id=sa; Password=; "The Set rstEmployees=New ADODB. You 'using client-side cursor activation AbsolutePosition properties, RstEmployees. CursorLocation=adUseClient RstEmployees. Open "employee," strCnn,,, adCmdTable 'enumeration recordset, The Do While Not rstEmployees. EOF 'display the current record information, StrMessage="Employee:" & amp; RstEmployees! LName & amp; VbCr & amp; _ "(record" & amp; RstEmployees. AbsolutePosition & amp; _ "Of" & amp; RstEmployees. RecordCount & amp; ")"If MsgBox (strMessage vbOKCancel)=vbCancel _ Then the Exit Do RstEmployees. MoveNext Loop RstEmployees. Close End Sub
key to set CursorLocation=adUseClient AbsolutePosition is the line number, starting from 1 [Quote=MSDN help: 6.0] AbsolutePosition and sample CursorLocation attribute This example to explain how the AbsolutePosition attribute to enumerate all you record the circulation process of tracking, it sets the cursor to the client cursor, using CursorLocation activation AbsolutePosition attribute, Public Sub AbsolutePositionX () Dim rstEmployees As ADODB. You Dim strCnn As String Dim strMessage As String 'using client-side cursor table for employee opens a recordset, StrCnn="Provider=sqloledb;" & _ "Data Source=the SRV; Initial Catalog=pubs; User Id=sa; Password=; "The Set rstEmployees=New ADODB. You 'using client-side cursor activation AbsolutePosition properties, RstEmployees. CursorLocation=adUseClient RstEmployees. Open "employee," strCnn,,, adCmdTable 'enumeration recordset, The Do While Not rstEmployees. EOF 'display the current record information, StrMessage="Employee:" & amp; RstEmployees! LName & amp; VbCr & amp; _ "(record" & amp; RstEmployees. AbsolutePosition & amp; _ "Of" & amp; RstEmployees. RecordCount & amp; ")"If MsgBox (strMessage vbOKCancel)=vbCancel _ Then the Exit Do RstEmployees. MoveNext Loop RstEmployees. Close End Sub
Page link:https//www.codepudding.com/Softwareengineering/38490.html