0

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!

2
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by smile4evr
0

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)
Else
  Label7.Caption = ""
End If
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.