dBase

  • Thread starter Thread starter Charles A. Lackman
  • Start date Start date
C

Charles A. Lackman

Hello,

I am working with a dBase Plus database and I cannot create a connection
string to the darn thing. I have tried the Fox Pro Driver, ISAM and others
and I keep getting "File is not a valid Table" exception. When I look at my
ODBC Data Source Administrator I see a "Driver do Microsoft dBase" driver,
but how would I access or use this driver in code to connect to the table?

Accomplishing this is VB.NET is very important but using ADO or ODBC is ok
with me, I just need to connect.

Dim AConnectionString as String
Dim AConnection as ODBC.ODBCConnection

AConnectionString = "Provider=????????????????????????????????)

AConnection = New ODBC.ODBCConnection(AConnectionString)

AConnection.Open

Thanks,

Chuck
 
Hi Charles,

As Cor indicated, this connection string works fine using the ODBC driver:

Dim oconn_d As New OdbcConnection("Driver={Microsoft dBase Driver
(*.dbf)};UID=admin;usercommitsync=yes;threads=3;statistics=0;safetransactions=0;pagetimeout=5;maxscanrows=8;maxbuffersize=2048;FIL=dBase
IV;DriverID=533;deleted=0;defaultdir=f:\olddbfs;dbq=f:\olddbfs;collatingsequence=ascii;")
Try

oconn_d.Open()

Catch ex As Exception

MessageBox.Show(ex.Message)

End Try

You will have to download the odbc driver for .net from msdn.microsoft.com;
then make a reference to it and then use an imports statement at the top of
your form. Let me know if I can be of help.

Bernie Yaeger
 
Back
Top