Solved

Exporting Access Table

Posted on 2004-04-27
8
152 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

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…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…

773 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