creating a .dbf file using Access VBA code

  • Thread starter Thread starter Gez
  • Start date Start date
G

Gez

Hi,

How do you create .dbf file using Access VBA code. I can do it manually
using the export option but I can't work out how to do it with code.

Cheers,

Geraint
 
In VBA Help, check out the TransferDatabase method. One of its arguments is
Database Type, which allows output to dBase file formats.
 
You can use a query if you prefer:

SELECT column-list

INTO file-name-without-extension

IN "c:\YourFolder" "dBase IV;"

FROM Your-Access-table;



[]

Luiz Cláudio C. V. Rocha

São Paulo - Brazil
 
Luiz,

Thats exactly what I was looking for, thank you!


Luiz Cláudio said:
You can use a query if you prefer:

SELECT column-list

INTO file-name-without-extension

IN "c:\YourFolder" "dBase IV;"

FROM Your-Access-table;



[]

Luiz Cláudio C. V. Rocha

São Paulo - Brazil


Gez said:
Hi,

How do you create .dbf file using Access VBA code. I can do it manually
using the export option but I can't work out how to do it with code.

Cheers,

Geraint
 
TransferDatabase does allow you to transfer the table to an existing .dbf
but it does not appear to automatically create a new .dbf file. Unless I'm
doing something wrong!
 
Damn, I may have spoken too soon. The sql method works in as far as it
creates a new .dbf file but it does not appear to have exported the ole
objects from the original table. Are any additional parameters required?

The manual export to .dbf method does export this detail so it must be
possible, but how?
 
Back
Top