Access VBA Macro Programming

(Joao Candeias) #1
Double-click the SQL Server Native Client 10.0 and you will be taken to the screen in
Figure 19-3. Give your DSN a descriptive name and enter the name of the server. This will be
the name of the server such as MyServer, but it can also be the IP address of the server, such
as 123.124.56.24.
If you have SQL Server running on your local machine, you can use [local] or the name of
your computer as the server name.
A drop-down is available on this field, but it does not always contain anything useful, so
do not be surprised if your server is not listed.
If you prefer, the Description field can be left blank because it only identifies what the
DSN is about in the DSN screen; it is not used in your code at all.
Click Next to move to the next screen. Click the radio button for SQL Server authentication.
The Login and Password fields will now be enabled. Enter these details. See Figure 19-3.
Click Next and you will be connected to your SQL Server Database. At this point, you
may see error messages, usually because your server name is not valid on your network, or
because you are using the wrong ID and password. If this happens, check that the server
name, ID, and password are all correct and that you are using the proper driver. Check with

242 Microsoft Access 2010 VBA Macro Programming


Figure 19-2 Selecting an ODBC driver for the data source
Free download pdf