Solved

Exporting Access Table

Posted on 2004-04-27
8
153 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
ID: 10932929
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
ID: 10933197
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
ID: 10938452
In Access, goto the File menu, select Import/Export, select Table or Query to export.... no programming required.

-EvadR
0
 

Author Comment

by:rod69
ID: 10939120
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
ID: 10940999
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

856 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