Exporting table to .dbf

J

Jaybird

I'm trying to export a table to my desktop using the TransferDatabase method.
Here's the code behind my command button:

Private Sub Command58_Click()
DoCmd.TransferDatabase acExport, "dBase IV", "C:\Documents and
Settings\Windows\Desktop\Order Entry 2005 Current.mdb", acTable,
"HDRPLAT.dbf", "C:\Documents and Settings\Windows\Desktop"
End Sub

Access tells me this is not a valid path. I got it by using ?CurrentDB.Name
in the Immediate Window. Any idea what the deal is?
 
K

Ken Snell \(MVP\)

TransferDatabase is used to copy an object into another, existing ACCESS
database file. You cannot use it to create an ACCESS file, nor to export the
information to a non-ACCESS file format.

You can use TransferText to export data to a text file format (with a file
extension of .txt, .csv, .asc, or .tab), and then you can import those data
into a .dbf file using the .dbf file's software's options.
 
J

Jaybird

Hmmm... Ken, I'm sure you are right. Somehow, I've stumbled onto a
workaround, I guess. I remembered reading up on this a while ago but I was a
little sketchy on the details. I tried to use the technique as in my earlier
message, but couldn't manage to get it right. Maybe because it isn't
possible, as you say. So I used a macro triggered by an on click event
instead. The macro was comparatively easy to set up and did the trick very
well. I use it to export the contents of some tables that need to be
uploaded to our corporate accounting system. It seems to work.
--
Why are you asking me? I dont know what Im doing!

Jaybird


Ken Snell (MVP) said:
TransferDatabase is used to copy an object into another, existing ACCESS
database file. You cannot use it to create an ACCESS file, nor to export the
information to a non-ACCESS file format.

You can use TransferText to export data to a text file format (with a file
extension of .txt, .csv, .asc, or .tab), and then you can import those data
into a .dbf file using the .dbf file's software's options.
 

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