By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,899 Members | 1,066 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,899 IT Pros & Developers. It's quick & easy.

importing .dbf or opening with ado

P: n/a
I need to get data from a table in .dbf format. I try importing it,
but get "external table not in expected format".

So I tried this VB code to see if I could get at my records with ADO
(which I am very new to)

"
With cnn1
..Provider = "microsoft.jet.oledb.4.0"
..Open "dBase
IV;HDR=NO;IMEX=2;DATABASE=C:\projects\leshrc\urs;T ABLE=needlx#dbf"
End With

With rst1
..ActiveConnection = cnn1
..CursorType = adOpenDynamic
..CursorLocation = adUseClient
..LockType = adLockOptimistic
..Open strSQL
End With

"
and I got the same "external table not in expected format"

so I poked around the internet, and it said this is probably because
the table is in a higher version of foxpro. I learned I should
download and install the MS foxpro data provider, which I did. I
tried the same thing with the same Error.

Then I tried changing provider to

"
With cnn1
..Provider = "Provider=VFPOLEDB.dll"
..Open _
"dBaseIV;HDR=NO;IMEX=2;DATABASE=C:\projects\leshrc \urs;TABLE=needlx#dbf"
End With
etc
"

This time I got "Provider cannot be found. It may be improperly
installed"

Are there steps I am missing? How do I get at the data in that table?
May 15 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Hi Donald,

You can create an ODBC DSN in Control Panel/Administrative
Tools/DataSources (ODBC). Make sure to select the System tab. You want
to create a System DSN. This will support the DBF format. When you
click Add and get the list of ODBC drivers, Microsoft has one for Dbase
tables (DBF). Then you can connect to your table through ODBC.

Rich

*** Sent via Developersdex http://www.developersdex.com ***
May 15 '06 #2

P: n/a
Still having no luck.Still getting "external table not in expected
format" I also downloaded and installed the visual foxpro ODBC driver
but that doesn't change it.

When I create the connection, what should I call the Provider?


On Mon, 15 May 2006 23:31:24 GMT, Rich P <rp*****@aol.com> wrote:
Hi Donald,

You can create an ODBC DSN in Control Panel/Administrative
Tools/DataSources (ODBC). Make sure to select the System tab. You want
to create a System DSN. This will support the DBF format. When you
click Add and get the list of ODBC drivers, Microsoft has one for Dbase
tables (DBF). Then you can connect to your table through ODBC.

Rich

*** Sent via Developersdex http://www.developersdex.com ***

May 16 '06 #3

P: n/a
It may be possible that you don't have a good file. Try opening your
file with Excel. I have never had a problem opening a DBF table in
Access. One other thing you could try is just linking directly to the
DBF file from Access like you would any other Access DB from the table
window -- r-click in the database window (Table Tab), select "Link
Tables". In the drop down you have like 4 different DBF format types
you can choose from. Try any of those. If that doesn't get it, and you
can't open the file in Excel, then the file may not be a good fie.
Lastly, if you have access to the original native environment where this
file was created you should be able to open it there for sure - if not,
then the file is corrupt.

Rich

*** Sent via Developersdex http://www.developersdex.com ***
May 16 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.