Access VBA Macro Programming

(Joao Candeias) #1

If you do not have access to SQL Server, you can download SQL Server Express free of
charge from http://www.microsoft.com/Sqlserver/2005/en/us/express.aspx.
To begin, you must first set up an ODBC link to point to the database you want to work
with. This is done by setting up a DSN (Data Source Name). You do this by selecting Control
Panel in Windows, then Administrative Tools (Windows XP only), and then Data Sources
(ODBC). It also works for Vista and Windows 7.
The ODBC Data Source Administrator dialog will appear, as shown in Figure 19-1.
If you have installed SQL Server or SQL Server Express, the drivers for SQL Server
will display.
If you do not already have a data source name (DSN) set up for the database, click Add.
This will give you a list of available database drivers, as shown in Figure 19-2. A DSN is
exactly what it says: It is a name of an ODBC link to a database that you can use to refer to
that ODBC link. A wide variety of these are available and some have titles in different
languages, but I am going to demonstrate SQL Server first.


Chapter 19: Working with External Databases 241


Figure 19-1 The ODBC Data Source Administrator window

Free download pdf