by Mario Caringal (Mariosoft) (1 Submission)
Category: Databases/Data Access/DAO/ADO
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Mon 17th January 2005
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Searching the database between two set of dates
API Declarations
2 Text control label it with (t1, and t2)
1 mshflexgrid
1 command button
Dim conn As ADODB.Connection
Dim rs As ADODB.Recordset
Function connectDB()
Set conn = New ADODB.Connection
Set rs = New ADODB.Recordset
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source= " & App.Path & "\databasename.mdb"
End Function
Private Sub Command1_click()
Call connectDB
rs.Open ("select t from tr group by t having t between #" & dt1 & "# and #" & dt2 & "#"), conn, , adLockOptimistic
Set MSHFlexGrid1.DataSource = rs
Set rs = Nothing
Set conn = Nothing
End Sub