473,324 Members | 2,246 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

importing .dbf or opening with ado

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
3 6207
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Skc | last post by:
I have a .txt which has been exported as a .csv from an external source. What i need to do is to import this into SQL2000 (into a table) but I need to do special things on the data: 1. I need to...
3
by: patcho | last post by:
Hello, I have a problem that I was hoping to get some assistance with. I have built a split database (back end with all the tables and a password to protect the information & a front end to link...
3
by: Phil | last post by:
Hi, I am a novice user so please be gentle.;-) I am trying to import a very large CSV file with an extension of .DRF Access wont let me import it because DRF is not one of the extensions...
1
by: ANSWER | last post by:
Hi, Is there any way I could disable someone to create a new database and import all of my tables into his database. I make .mde, disable shift+Enter, make logon module but still my tables are...
11
by: David Lozzi | last post by:
Hello, I need to automate importation of a excel file into a table. Here's my scenario: I'm writing an ASP.NET application where users can pull reports on imported data. The imported data is...
0
by: Syvman | last post by:
Is there a parameter to set to allow opening Excel file read only while it is already open by another user? I've tried the .mode setting in my connection string to adModeRead, but it still won't...
1
by: hedgracer | last post by:
I have set up the following vba code: DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "Sheet1", _ "Z:\Accounting\DataArchive\Monthly_Database_Data\Copy of NIGHTFILLS JUL...
11
by: kaisersose1995 | last post by:
Hi, I've got an import procedure working, using a standard import specification to import a .csv file into a temporary table. The problem i'm having is that i have 4 different sets of borrower...
2
by: Alun Jones | last post by:
I'm getting the above error in a dialog box from Visual Studio 2005 when trying to sign an assembly using a PFX file, and would like to know how to resolve the problem. Background: The PFX...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.