Database Reference
In-Depth Information
Figure 14.3
Successful installation of MyODBC.
Setting Up a Data Source
The next step in using MyODBC is setting up your data source. This can be done directly in
Windows by using the data source control in control panels. Select Control Panel from your
start menu. Depending on your version of Windows, you may see the Data Sources or
ODBC control straight away. In Windows XP you first need to open up the Administrative
Tools section of the control panel to find the correct icon. The icon is shown in Figure 14.4.
Double click on the data source or ODBC icon in your control panel. The data source
control is shown in Figure 14.5.
You will notice that there may already be some data sources set up. You can have two dif-
ferent types of data source, a user data source and a system data source. The user data
source is only available to the current user who is logged in, whereas the system data source
is available to anyone who is using the machine. Although there are some security issues
with using a system data source, this is the type that we will be using for our example. Click
on the System DSN tab and click on Add .
You will then be presented with a list of drivers, as shown in Figure 14.6, which will vary
depending on what software you have previously installed on your machine. Scroll down
until you find the MySQL entry that corresponds to the drivers you have just installed and
click on it. Next, click on the Finish button. This does not actually finish the data source
setup but takes you to the options for the new data source as shown in Figure 14.7.If you
are using an earlier version of MyODBC, this may well look different.
Fill in the fields in this control as shown in the figure, referring to the following:
The Data Source Name will be the name that you refer to the data source with within
your code.
Search WWH ::




Custom Search