hey all... my project is showing some error in this code... plz help...

Dim RS As New adodb.Recordset
Dim getname As String
Dim logginname As String
getname = "SELECT E_name FROM Employee_Details WHERE E_ID ='" & logid.Caption & "'"
CN.Execute getname
RS.Open getname, CN
Label7.Caption = RS.Fields(0)

thnx! good day!

What error message exactly?

Do you have CN open?

Dim CN As ADODB.Connection
CN = New ADODB.Connection
CN.Open "<connection string>"

Also the recordset could be empty:

If RS.Fields.Count > 0 Then
  Label7.Caption = RS.Fields(0)
  Label7.Caption = ""
End If

thax... worked great... hv a good day!