hi can someone tell me how can I search the database using dtpicker. I am usinf vb6 and ms 2003 and I need to display the date of birth of a on 3 textboxes,namely the firstname, lastname and middlename and also in a listview. please help me. this is my primary code for that but it is not working:
Private Sub search_image ()
dim rs as recordset
dim list as listitems
set rs = new recorset
rs.open "select * from tblrecord where Birthday = '" & DTPicker1 & "'", cn, adOpenDynamic, adLockOptimistic
If RS.EOF Then
MsgBox "Record Not Found!", vbExclamatio
Else
lastn.text = RS.Fields("Lastname")
'etc....
lsvrec.ListItems.Clear
Set list = lsvbap.ListItems.Add(, , RS!Lastname)
list.ListItems.SubItems(1) = RS!Firstname
list.ListItems.SubItems(2) = RS!Middlename
End If
End Sub
please help. :)