Read a DBASE III file in VB.NET

M

Maurice Mertens

Hi,

how can I open and read a DbaseIII file in .NET?


--
Met vriendelijke groet / With regards / Saludos,
Moviat Automatisering


Maurice Mertens
mauricem@moviat_KillSpamWordForEMail.nl

tel: +31 162 470 534
fax: +31 162 470 502
 
G

Guest

This might wor

In Server Explorer
New Add Connectio
Select as Provider Microsoft OLEDB provider for ODBC Driver
Select dBASE files as DataSource Nam
Enter as Initial the directory which holds your table(s). Not the tables itsel
Test Connectio

Now you can the table to your form
I'll write a next message with the code exampl

Marinus Holkem
 
P

Paul Clement

¤ Hi,
¤
¤ how can I open and read a DbaseIII file in .NET?

You can use Jet OLEDB and the ISAM driver as in ADO:

Private Sub ConnectTodBaseDataReader()

Dim ConnectionString As String

ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=e:\My Documents\dBase;Extended Properties=dBase III"
Dim dBaseConnection As New System.Data.OleDb.OleDbConnection(ConnectionString)
dBaseConnection.Open()

Dim dBaseCommand As New System.Data.OleDb.OleDbCommand("SELECT * FROM MyDBase",
dBaseConnection)
Dim dBaseDataReader As System.Data.OleDb.OleDbDataReader =
dBaseCommand.ExecuteReader(CommandBehavior.SequentialAccess)

While dBaseDataReader.Read
Console.WriteLine(dBaseDataReader("Column1").ToString)
Console.WriteLine(dBaseDataReader("Column2").ToString)
Console.WriteLine(dBaseDataReader("Column3").ToString)
End While

dBaseConnection.Close()

End Sub


Paul ~~~ (e-mail address removed)
Microsoft MVP (Visual Basic)
 
M

Maurice Mertens

Thanks Paul, I will try this code !!!



--
Met vriendelijke groet / With regards / Saludos,
Moviat Automatisering


Maurice Mertens
mauricem@moviat_KillSpamWordForEMail.nl

tel: +31 162 470 534
fax: +31 162 470 502
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top