Hi Fred,
Here is what I do to read from an Access MDB into a VB.Net app which
does not seem to have any issues:
Imports System.Data.OleDB
Public Class Form1
Private Button1_Click(...) handles Button1.Click
Dim Conn As New OleDBConnection("Provider=Microsoft.Jet.OLED.4.0;
Data Source="C:\test1.mdb;")
Dim da As New OleDbDataAdapter, ds As New Dataset
da.SelectCommand = New OleDbCommand
da.SelectCommand.Connection = conn
da.SelectCommand.CommandTye = CommandType.Text
da.SelectCommand.CommandText = "Select * from Table1"
da.Fill(ds, "tbl1")
dgrv1.DataSource = ds.Tables("tbl1")
End Sub
End Class
dgrv1 is a datagridview that I use to display the data from my test
table in the Access mdb called Table1. I alias this table in the VB.Net
app as "tbl1" (for distinguishing purposes). If you want to read back a
specific row, just change the commandText in the select command like
Select * from Table1 Where ID = 5
You could also use a straight forward command object instead of a
dataAdapter, but the dataAdapter has a lot more methods/properties built
into it than the command object. It encapsulates more stuff - like
dealing with apostrophes, particularly in parameters.
Regards,
Rich
*** Sent via Developersdex
http://www.developersdex.com ***