how to get id of selected row or clicked cell row in datagrid in vb6.0?


Maybe something like this.

Private Sub DataGrid1_Click()

Dim x As String

x = Adodc1.Recordset("ID").Value
Adodc1.RecordSource = "Select * from Users where ID = '" & x & "'"

Label1.Caption = x

End Sub

Note that:

I used an ADODC since you did not specify what connection type you are using.
I used a label to display the ID value (selected).