Problem with DBase in ADO.NET

B

bob

Can you help? I am trying to read a table in a dbase database

strMyDB = HttpContext.Current.Server.MapPath(".") & pstrPathName

strDB = "Driver={Microsoft dBase Driver (*.dbf)};Data
Source=" & strMyDB
' the connection object
mdbDatabase = New OdbcConnection(strDB)

' open the connection
mdbDatabase.Open()


mdaIC031016 = New OdbcDataAdapter
mdaIC031016.SelectCommand = New OdbcCommand("Select * from
IC031016", mdbDatabase)

Dim dsAny = New DataSet

mdaIC031016.Fill(dsAny, "IC031016")

The Fill fails:
The message is

5: Procedure call or argument is not valid.

Thanks,

Bob Avallone
MetaPro Systems Inc.
www.metaprosystems.com
 
T

Tim Anderson

Can you help? I am trying to read a table in a dbase database

strMyDB = HttpContext.Current.Server.MapPath(".") & pstrPathName

strDB = "Driver={Microsoft dBase Driver (*.dbf)};Data
Source=" & strMyDB

Some dBase tables can be read by the FoxPro driver. Would this work for you?
Then you could use the OLEDB provider instead of the ODBC provider.

Tim
Introducing XML:
http://www.itwriting.com/xmlintro.php
 
M

Miha Markic

Hi,

Try with connection string like
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\folder;Extended
Properties=dBASE IV;User ID=Admin;Password="
this one.
 

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