Jobs
Author: Mario Caringal (Mariosoft) Date Submitted: 1/17/2005 Category: Database Compatibility: VB 6 This code has been accessed 10313 times.
Email Yourself this snippet:
Requirements 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
Code
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