Hello Ganesh, if this your first time to do connection, you need to add a component.
Very easy, go to properties, select "References", add the Microsoft ActiveX Data Objects 2.0 Liabrary.
This is a code to insert in command1.
Public Sub Command1_Click()
Dim masql As String
Dim con As New adodb.Connection
Dim rs As New adodb.Recordset
Set con = New adodb.Connection
Set rs = New adodb.Recordset
rs.CursorLocation = adUseClient
con.ConnectionString = _
"Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & App.Path & "\wage.mdb"
con.Open
CODE
masql = "SELECT * From Table1 WHERE Date BETWEEN '01/01/2008' And '10/01/2008'"
rs.Open masql, con, adOpenDynamic, adLockOptimistic
rs.MoveFirst
Set DataGrid1.DataSource = rs
End Sub
Take Care.
Anand.
This post has been edited by anand_the_great: 13 May, 2008 - 12:50 AM