Here's an example of a dynamic connection string...
Dim strSQL As String = "SELECT * FROM SomeTable"
Dim cn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Password="""";User ID=Admin;Data Source=" & Application.StartupPath & "\myDatabase.mdb")
Dim cmd As New OleDbCommand(strSQL, cn)
Dim da As New OleDbDataAdapter(cmd)
Dim ds As New DataSet()
da.Fill(ds, "SomeTable")
With DataGrid1
.DataSource = ds.Tables(0)
.Visible = True
End With