Problem with DBase in ADO.NET

  • Thread starter Thread starter bob
  • Start date Start date
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
 
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
 
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.
 
Back
Top