Exporting Table to DBase IV (*.dbf) with VBA (1 Viewer)

DevastatioN

Registered User.
Local time
Today, 01:11
Joined
Nov 21, 2007
Messages
242
Hello guys,

I am working on a database that requires a user (with very little access knowledge) to export a table into .dbf (DBase IV Format) using a button and VBA.

I realize this can be done by right clicking on a table and click export. However I did not give the end user access to the tables (being a good DB Developer!) and also I don't believe I can teach this particular user how to do the steps to accomplish this.

The scenario: Third party software needs (SwissSys, which is a chess software) to grab information about players and ratings from a .dbf file (and will not work with access). I have developed a database for the association so that they can edit players information, and update the ratings directly off the website (www.chess.ca) and it automatically updates in the database.

The idea is, the Access Database updates the ratings from the website, and then the user exports that data into the dbf file (players table) that is directly linked to the third party software.

I am looking for a way to use VBA code to either 1. Create/Overwrite the existing dbf file when exporting the tblPlayers, or 2. Append/Update the current dbf file with the updated ratings, and creating new entries when necessary when exporting the tblPlayers.

Unfortunately I have had little success in finding code to export to a dbf file, anyone have any ideas?
 

RuralGuy

AWF VIP
Local time
Yesterday, 22:11
Joined
Jul 2, 2005
Messages
13,826
Have you looked at the TransferDatabase function in VBA help?
 

DevastatioN

Registered User.
Local time
Today, 01:11
Joined
Nov 21, 2007
Messages
242
Thanks!

This is a function I had not used before in the past so was unclear on how it works, it actually creates the dbf file on the other end without it needing to be created.

I had looked at exporting this a few times onforums etc. but many things I have come across said it was impossible to export to dbf.

For future users reading this, the VBA code I used was:

Dim access As Access.Application
Set access = CurrentProject.Application
access.DoCmd.OpenTable "Table1"
access.DoCmd.TransferDatabase acExport, "dBASE IV", "c:\", acTable, "Table1", "Filename.DBF"
DoCmd.Close acTable, "Table1"
 

RuralGuy

AWF VIP
Local time
Yesterday, 22:11
Joined
Jul 2, 2005
Messages
13,826
Glad we could help. Have fun with the rest of the project.
 

Users who are viewing this thread

Top Bottom