Huh, Should be a system.data thing, not a VB Express thing. ISAMS can an
ODBC driver but I find it faster and easier to use the Jet ISAM drivers.
I used Access to export the Biblio.mdb Authors table. Then opened VB
Express and started a new forms project.
Added a reference to System.Data.Dll and System.XML.dll.
Then added a datagridview, named it "grid1" and a button to the form.
At the top of the form I added Imports System.Data & Imports
System.Data.Oledb
In the button click I added:
Dim cn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; " & _
"Data Source=C:\testarea;" & _
"Extended Properties=""dBase III""")
Dim ds As New DataSet
Dim da As New OleDbDataAdapter("Select * from Authors", cn)
Try
cn.Open()
da.Fill(ds)
grid1.DataSource = ds.Tables(0)
Catch ex As Exception
MsgBox(ex.ToString)
End Try
And there it was. Remember that for xbase files the folder where the files
are is the "Database" so in the above, my dbf and ndx files are in the
folder "C:\testarea" and the "Tables" are the dbf files themselves. Also
remember that the ISAM type name has to be exact in the connection string so
it's "dBase III" (with a space) for dbase 3, dBase IV for 4 and so on.
Hope that helps.
Robert Smith
Kirkland, WA
www.smithvoice.com
"Erik Edlund" <er**@norrsken.nu> wrote in message
news:MV******************@newsb.telia.net...
I am trying to open a table in dbf format using VB Express. There seems to
be no explicit provider alternative. A few of the providers reports that
"Test connection succeeded.", but when I try to use the connection I get
the message "Unable to connect to database. This feature is not supported
by M$ VB Express."
Is this a dead end or is there a workaround? I need to read the file and
would be very pleased if I could write to it as well.
Thanks in advance for the answers.
Erik Edlund