Go Back   Access World Forums > Microsoft Access Discussion > Tables

 
Reply
 
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
Old 02-22-2008, 04:27 AM   #1
DevastatioN
Newly Registered User
 
Join Date: Nov 2007
Location: Nova Scotia, Canada
Posts: 242
Thanks: 0
Thanked 6 Times in 5 Posts
DevastatioN is on a distinguished road
Exporting Table to DBase IV (*.dbf) with VBA

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?

DevastatioN is offline   Reply With Quote
Old 02-23-2008, 03:35 AM   #2
RuralGuy
AWF VIP
 
RuralGuy's Avatar
 
Join Date: Jul 2005
Location: @ 8300' in the Colorado Rockies
Posts: 13,793
Thanks: 6
Thanked 307 Times in 297 Posts
RuralGuy is just really nice RuralGuy is just really nice RuralGuy is just really nice RuralGuy is just really nice RuralGuy is just really nice
Have you looked at the TransferDatabase function in VBA help?
__________________
(RG for short) aka Allan Bunch Previous MS Access MVP acXP, ac07, ac10, ac13 - WinXP Pro, Win7 Pro, Win10 Pro
Please post back to this Forum so all may benefit.
Teaching is not filling a bucket but lighting a fire.
RuralGuy is offline   Reply With Quote
Old 02-27-2008, 04:40 AM   #3
DevastatioN
Newly Registered User
 
Join Date: Nov 2007
Location: Nova Scotia, Canada
Posts: 242
Thanks: 0
Thanked 6 Times in 5 Posts
DevastatioN is on a distinguished road
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"

DevastatioN is offline   Reply With Quote
Old 02-27-2008, 07:09 AM   #4
RuralGuy
AWF VIP
 
RuralGuy's Avatar
 
Join Date: Jul 2005
Location: @ 8300' in the Colorado Rockies
Posts: 13,793
Thanks: 6
Thanked 307 Times in 297 Posts
RuralGuy is just really nice RuralGuy is just really nice RuralGuy is just really nice RuralGuy is just really nice RuralGuy is just really nice
Glad we could help. Have fun with the rest of the project.

__________________
(RG for short) aka Allan Bunch Previous MS Access MVP acXP, ac07, ac10, ac13 - WinXP Pro, Win7 Pro, Win10 Pro
Please post back to this Forum so all may benefit.
Teaching is not filling a bucket but lighting a fire.
RuralGuy is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Must I have ODBC table Linked for VBA code to work? Air_Cooled_Nut Modules & VBA 6 07-10-2007 12:14 PM
How to checked whether the access database table is open by the user with vba? jack1234 Modules & VBA 1 06-24-2007 09:35 AM
Vba to move data from table to table CharlesWh Modules & VBA 3 01-24-2006 12:38 PM
append a record to a table using vba where the table contains an autonumber marky_dp Modules & VBA 2 01-07-2006 10:07 PM
exporting multiple versions of a report based on a reference table Bhaughbb Reports 1 08-24-2005 07:49 AM




All times are GMT -8. The time now is 06:43 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Sponsored Links

How to advertise

Media Kit


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World