On 12 Jun 2006 08:53:38 -0700, (e-mail address removed) wrote:
¤ What dataadapter should I use and can I use something such as
¤ DataDirectory in the connection string? Can you give me an example?
Below is an example:
Dim AccessConnection As System.Data.OleDb.OleDbConnection
Try
AccessConnection = New
System.Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & FilePathToDatabase)
AccessConnection.Open()
Dim da As New System.Data.OleDb.OleDbDataAdapter("SELECT ...", AccessConnection)
Dim ds As New DataSet
da.Fill(ds, "MyDataTable")
frmMain.DataGrid1.SetDataBinding(ds, "MyDataTable")
Catch ex As Exception
MessageBox.Show(ex.Message)
Finally
AccessConnection.Close()
End Try
Paul
~~~~
Microsoft MVP (Visual Basic)