Solved

Exporting Access Table

Posted on 2004-04-27
8
150 Views
Last Modified: 2010-05-02
Hi,

I have to export an Access table or query using Visual Basic.
My options are fixed file format, comma delimitted file or excel
spreadsheet with columns.
Which one is better and faster?

Thanks
0
Comment
Question by:rod69
  • 3
  • 2
8 Comments
 
LVL 1

Expert Comment

by:EvadR
Comment Utility
It depends on what you want to do with it once it is exported.  Fixed file format would probably be larger but easier to read (if you had to look at as a text file), comma delimited would probably be the most common and easiest to import into something else unless of course you're importing it to Excel, then Excel format would be the obvious choice.

All in all, it might not make a difference... again, it really depends on what you want to do with it.

HTH,
-EvadR
0
 

Author Comment

by:rod69
Comment Utility
I'll need to export data for somebody else, so once I exported I'm not going to use it anymore. My question is which one is easier to programm.

0
 
LVL 1

Expert Comment

by:EvadR
Comment Utility
In Access, goto the File menu, select Import/Export, select Table or Query to export.... no programming required.

-EvadR
0
 

Author Comment

by:rod69
Comment Utility
I have to do it with Visual Basic that's why I', asking for help.
I need like a button in a form to do the job.
0
 
LVL 1

Accepted Solution

by:
EvadR earned 75 total points
Comment Utility
I was afraid you were going to say that, but no worries:

0. Open a text file with append access.
1. Create a recordset with all your data.
2. Looping thru the recordset...
3. Inner loop for each field...

4A. Output to the text file the value of the field with a comma on the end.

4B. Output to the text file the value of the field, padding the value with spaces the length of the field definition.

-EvadR
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now