Access: Querying external DBs "on the fly"

by Olaf Rabbachin 8. February 2005 21:53

This sample database shows how to query an external database "on the fly", that is, without linking any table of that external database to the current one. Instead, a SQL-string will be constructed that may be used from within code or that may be passed to i.e. a combobox or listbox.
The MDB allows you to choose a database-file and will then display all tables and/or queries therein. After choosing a table or query, all records will be pushed into a listbox (if possible).
This approach is most useful i.e. in scenarios where multiple backend-databases are being used. In such cases, using queries as tables (i.e., instead of tables) and simply modifying those queries' SQL-portion after the backend-database has to be changed will be way faster than using linked tables along with TableDef.RefreshLink.

This is one of the older entries that can also be found on the original Access-site.

Download: QueryOnTheFly_A2k.zip (46.34 kb)


Location: PostList

Tags: , ,

Access/VBA

Access: DAO-lookup for Listbox-controls

by Olaf Rabbachin 28. January 2002 21:26

This demo-MDB shows a class that will find the first corresponding entry in (i.e.) a listbox whenever a key is tapped in. The code is encapsulated in a class for easy use in your own apps.

This is one of the older entries that can also be found on the original Access-site.

Download: DAO_Lookup_A2K.zip (54.16 kb)


Location: PostList

Tags: , ,

Access/VBA

Access: adjustable Listbox-columns

by Olaf Rabbachin 1. January 2002 21:04

This sample shows how to automatically resize a listbox's column-widths and, while at it, adjust command-buttons (that were created in order to serve as column-headers) as well. The command-buttons implement an ORDER BY-functionality which will re-sort the listbox's contents at the matter of a mouse-click and a single line of code. This is an A97-MDB but can easily be converted into later versions.

This is one of the older entries that can also be found on the original Access-site.

Download: adjustableListboxColumns_97.zip (28.81 kb)


Location: PostList

Tags: ,

Access/VBA

About

Hi and welcome to my blog!

I'm a developer from Germany, currently focusing on .Net and WPF.

More about me ...