I am developing a small software using VB6 and MS Access2000.
In one of the tables there is an datetime type column. I want to compare the value of this column with the date given in an combobox. For doing this I have given the following code. But it is not working. It is showing EOF as true. Anyone who can help me is most welcome.
Private Sub Command4_Click()
Dim rs1 As ADODB.Recordset
Set rs1 = New ADODB.Recordset
Dim dno As Integer
dno = CInt(Trim(Text1.Text))
Dim mydate As Date
mydate = CDate(Trim(Combo1.Text))
rs1.Open "select letter_no from tbldiary where diary_no= " & dno & " and diary_date= " & "" & dote & "", con, adOpenDynamic, adLockOptimistic
If Not rs1.EOF Then
Text3.Text = rs1(0)
End If
End Sub
In one of the tables there is an datetime type column. I want to compare the value of this column with the date given in an combobox. For doing this I have given the following code. But it is not working. It is showing EOF as true. Anyone who can help me is most welcome.
Private Sub Command4_Click()
Dim rs1 As ADODB.Recordset
Set rs1 = New ADODB.Recordset
Dim dno As Integer
dno = CInt(Trim(Text1.Text))
Dim mydate As Date
mydate = CDate(Trim(Combo1.Text))
rs1.Open "select letter_no from tbldiary where diary_no= " & dno & " and diary_date= " & "" & dote & "", con, adOpenDynamic, adLockOptimistic
If Not rs1.EOF Then
Text3.Text = rs1(0)
End If
End Sub