Monday, June 25, 2012

Access VBA: Creating Text File or Table from Query - CodeProject

Example SQL outer join query with Null placeho...
Example SQL outer join query with Null placeholders in the result set. The Null markers are represented by the word NULL in place of data in the results. Results are from Microsoft SQL Server, as shown in SQL Server Management Studio. (Photo credit: Wikipedia)
Introduction to this great article about using Access to create Textfiles based on data in the Database!

Access is both a handy tool and a pain in the neck to use. It removes all of the complexities of using SQL Server, DB2, or Oracle and provides a nice point and click interface. However, It does not follow all of the SQL rules and will not do full outer joins. Also, Access documentation and support sucks. It does provide a VBA interface that allows us to code around the problems.
My assignment was to run a stored query 90 times to get a sample set of data for 90 days. I came up with two solutions. The first created a text file using tab delimiters and the second built a table dynamically. The code should work for any record set created from any query.


Access VBA: Creating Text File or Table from Query - CodeProject
Enhanced by Zemanta

No comments: