By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,987 Members | 997 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,987 IT Pros & Developers. It's quick & easy.

problem in getting absolute positon of recordset

P: 13
Im using VB6. On rowcolchange event of may datagrid, im using the Frame caption to get the selected data. The problem is when I select the data on the grid. Its not showing the absolute position, still the first record.

This is my code:
Expand|Select|Wrap|Line Numbers
  1. Private Sub dgUser_RowColChange(LastRow As Variant, ByVal LastCol As Integer)
  2.     Dim deUser As ADODB.Recordset
  3.  
  4.     AdvantageEnvironment.cmdUsers
  5.     Set deUser = AdvantageEnvironment.rscmdUsers
  6.  
  7.        If deUser.RecordCount > 0 Then
  8.        frdet.Caption = "Record " & deUser.AbsolutePosition & " of " & deUser.RecordCount
  9.             If IsNull(deUser.Fields("username").Value) Then
  10.                 txtUserName.Text = ""
  11.             Else
  12.                 txtUserName.Text = deUser.Fields("username").Value
  13.             End If
  14.             If IsNull(deUser.Fields("userpass").Value) Then
  15.                txtPassword.Text = ""
  16.             Else
  17.                txtPassword.Text = deUser.Fields("userpass").Value
  18.             End If
  19.             If IsNull(deUser.Fields("fullname").Value) Then
  20.                txtFullName.Text = ""
  21.             Else
  22.                txtFullName.Text = deUser.Fields("fullname").Value
  23.             End If
  24.             If IsNull(deUser.Fields("position").Value) Then
  25.                txtPosition.Text = ""
  26.             Else
  27.                txtPosition.Text = deUser.Fields("position").Value
  28.             End If
  29.             If deUser.Fields("urg").Value = "True" Then
  30.                CheckURG.Value = 1
  31.             Else
  32.                CheckURG.Value = 0
  33.             End If
  34.             If (deUser.Fields("cashier").Value = "True") Then
  35.                CheckCASH.Value = 1
  36.             Else
  37.                CheckCASH.Value = 0
  38.             End If
  39.             If (deUser.Fields("services").Value = "True") Then
  40.                CheckSERV.Value = 1
  41.             Else
  42.                CheckSERV.Value = 0
  43.             End IF
  44. End Sub
  45.  
My recordset cursor location is Client-side cursor
cursor type = static
loc type = optimistic

What should i do? Please help me. Thanks.
Sep 10 '07 #1
Share this Question
Share on Google+
1 Reply


QVeen72
Expert 100+
P: 1,445
Hi,

Where have u mentioned Cursor location and lock type for deUser...?
Change the declaration of deUser, give New Keyword:

Expand|Select|Wrap|Line Numbers
  1. Dim deUser As New ADODB.Recordset
  2.  
What does this line Indicate..?:
AdvantageEnvironment.cmdUsers

Why Use Caption of some Control to save the Position...? Create a FormLevel Variable and Save the Position in that variable..


Regards
Veena
Sep 10 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.