Import DBF files with MEMO fields

G

Guest

I'm using MS Access 2002. I have to import data from DBF files everyday.
Every DBF files which has no MEMO fields will be imported succesfully, but
that won't happen for those DBF files which have a MEMO field. (In the past,
when I used MS Access 97, it's OK for all DBF files). To solve this, I have
to copy the DBF files that have MEMO field to other DBF files which have no
MEMO field, then import that files to Access.
Is there any other mean to import those DBF files to Access directly ?
 
C

Cindy Winegarden

Hi Khoa,

Use the FoxPro and Visual FoxPro ODBC drivers, downloadable from
msdn.microsoft.com/vfoxpro/downloads/updates/odbc .
 
G

Guest

Hi Cindy,

I am having the same issue,but the DBF files are in DBase III/IV format, and
are not FoxPro/Visual Fox Pro.

The issue I am having is with DBase III/IV files with Memo fields.

Joel
 
C

Charles E. Vopicka

i could be wrong but i think the point was that FoxPro uses dbase files
natively and therefore the drivers would support all data types that
FoxPro / DBF files have. since there are multiple drivers for ODBC one
should support full DBF format
Hi Cindy,

I am having the same issue,but the DBF files are in DBase III/IV format, and
are not FoxPro/Visual Fox Pro.

The issue I am having is with DBase III/IV files with Memo fields.

Joel


--
Charles E. Vopicka's (Chuck) : (e-mail address removed)

Database Management, GIS Specialist and Research Assistant

Forest Biometrics Research Institute
University of Montana - College of Forestry and Conservation
Missoula, MT 59812
United States of America

Phone:
(406)243-4526
(406)243-4264
(406)549-0647 (Home)

:) HAVE A NICE DAY (-:

"UNLESS" (The Lorax, by Dr. Seuss)
 
G

Guest

"You can find out whether you already have the Visual FoxPro ODBC Driver
installed by checking to see if a file called VFPODBC.DLL exists in your
Windows System directory." - And I found that file in C:\Windows\System32
Directory - That means I don't have to download/install FoxPro and/or Visual
FoxPro ODBC drivers ?
The DBF files are created by Foxpro 2.6 for Dos.
 
C

Cindy Winegarden

Hi Khoa,

You haven't said which version of the VFPODBC.DLL you have. The latest
FoxPro and Visual FoxPro ODBC drivers work with all versions of FoxPro
tables. What you have will probably work, but why not use the latest
version?

Others in this thread mentioned Dbase III, etc. files. I don't know if the
FoxPro and Visual FoxPro ODBC drivers support those files.
 
G

Guest

OK. I've tried to download and set it up onto my computer ..., and it doesn't
work. "External table is not in expected format" is the only thing I receive
(If the DBF files have at least 1 MEMO field).
Thanks anyway.
 
C

Cindy Winegarden

Hi Khoa,

Exactly how are you importing the file? Are you using ODBC data sources
rather than Dbase x? You need access the tables with the FoxPro ODBC and not
with the built-in Jet data engine.
 
G

Guest

GREAT !!! I've tried to import with the FoxPro ODBC, and it works ! Now I can
do everything with just a click. Thank you for your help so far, Cindy ! I
wonder why I didn't try this before, or ask this earlier. And I am happy to
join this thread.
Thank you very much indeed !
 
G

Guest

Hi Cindy,
You are so kind to help me so far. I can import the DBF file now, but there
are still many things to do (I mean manually). I've tried to write some VBA
code to do this with just one click but it dumps ... Could you plz write the
sample code to import the DBF, such as C:\db1.DBF to TB1 in msdb.MDB (Form1;
Button1 etc...)
Thank in advance.
 
C

Cindy Winegarden

Hi Khoa,

Here's VBA code to read external data and update an Access table:


Function AutoExec()
' Assume C:\Temp\HelloWorld.dbf - Field1 C(15)
' Assume table in MDB tblHelloWorld

Dim conn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim sqlCmd As String

Set conn = New ADODB.Connection
conn.ConnectionString = "DSN=Visual FoxPro
Tables;SourceDB=C:\Temp;SourceType=DBF;Exclusive=No;Deleted=Yes;"
conn.Open

sqlCmd = "SELECT * FROM HelloWorld;"
Set rs = New ADODB.Recordset
rs.Open sqlCmd, conn, adOpenDynamic, adLockOptimistic

Do Until rs.EOF
MsgBox (rs.Fields(0).Value)
CurrentDb.Execute "Insert Into tblHelloWorld (Field1) Values (""" &
rs.Fields(0).Value & """)" 'valueString)", dbFailOnError
rs.MoveNext
Loop

rs.Close
Set rs = Nothing

End Function
 

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