VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Searching the database between two set of dates

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


Rate Searching the database between two set of dates



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


Download this snippet    Add to My Saved Code

Searching the database between two set of dates Comments

No comments have been posted about Searching the database between two set of dates. Why not be the first to post a comment about Searching the database between two set of dates.

Post your comment

Subject:
Message:
0/1000 characters