|
Configuring ODBC The ODBC data source administrator is one of those things most users see on their Windows control panel, wonder what it does, and ignore it until that horrible moment comes when some program actually requires you to do something with it. Actually, it's not difficult at all to configure. Open Database Connectivity (ODBC) is a standard interface that lets you connect an application to a datasource. To do this, you set up a DSN (Data Service Name) which contains database and driver information then reference your application to it. The procedure below will give you some general information on DSNs, show the steps need to set one up, and tell you what other information you'll need. Database Drivers All databased don't use the same driver so you'll have to make sure you have the proper one for the database you're using. The following example will show you how to connect to an online MySQL database from your home PC using the MyODBC driver. You can find the myODBC driver by following the link. Drivers for other databases can be found by doing a websearch or contacting the database publisher's web site. To install the drivers, you generally just have to double click on the file you download. You may already have the driver you need as you'll see in the next section. Creating a DSN Open the ODBC Data Source Administrator by clicking on the Data Sources (ODBC) icon. On windows XP you can find it by first clicking the Administrative tools icon in your Control Panel Below is an image of the ODBC Data Source Administrator. This example is only interested in the first three tabs; User DSN, System DSN, File DSN. All three of these DSN types get set up the same way but have differences in how they operate. Both User and System DSNs are specific to the PC you're using and are stored in the registry. As their names imply, a User DSN can only be used by a specific user on the PC while a System DSN can be used by all users on the PC. A File DSN, unlike the other types, is saved in a text file with a .dsn extension. Since a File DSN isn't in the registry, it can be accessed by users on other PCs as long as they have the same drivers installed. Which you use is up to your situation and an application's requirements. Broadcast Builder, for instance doesn't seem to find File DSNs While SQLXP finds all three types. Those who use PCs with multiple users may prefer a User DSN to a System DSN to limit access to sensitive data. The technique for User and System DSNs is identical. 1) Click on the appropriate tab to select either a User or System DSN. The screen shot above shows the System DSN window. 2) Click the "Add" button. This will bring up a list of available drivers as shown in the image below. Find the driver that's appropriate for your database. For this example, select "MySQL ODBC 3.51 driver" which should be found toward the bottom of the list. Click "Finish". 3) A window containing specific information on the database you've chosen should pop up. The image below shows the configuration window for MySQL. Other database configuration windows will look different but they generally ask for the same information. Here is a brief description of the data fields: -Data Source Name - This is your reference for the DSN and can be any name you want. -Description - This should be automatically filled in and it tells you it's a DSN based on a certain driver. -Host/ServerName or IP - For a database located on you local PC use localhost or 127.0.0.1. For a remote database, use the IP address or host server name where the database is located. -Database name - The name of the database you want to access - you must fill in a new DSN for each different database. -User - Username associated with database. -Password - Password associated with database. Some database administration tools add a prefix to the password based on your account name. The resulting password has a format of prefix_password. If you can't connect using the entire password, delete the prefix_ and try again. -Port - Default is 3306 and you usually don't have to change it. -SQL command on connect - Add the SQL command you want to be performed when you connect. I've found this doesn't work with all applications and usually leave it blank. 4) Click "Test Data Source" and the following pop up will appear if it's successful. If it's not successful, check for the usual problems, typo in the password, wrong case letters, no internet connection to remote database, and try again. Busy network can cause problems due to delays. If the connection passes the test, you're done. To use your DSN just reference it from the application you want to use. Creating a File DSN uses the same technique except you're actually creating a file and have to specify where you want to put it. 1) Select the File DSN tab, click the "Add" button, then select the driver as described in steps 1 and 2 above. There will be no "Finish" button so click the "Next" button. 2) A new window will open and ask you to specify where the DSN will be placed. Use the browse button next to the text box to find the appropriate location. Enter the file name and location then click the "Next" button 3) The next window to open will have some information on the DSN for you to review before you create it. If you're satisfied with the results, click "Finish". 4) The MySQL configuration window shown above will open. Fill in the data as you did before. 5) Your new File DSN will show up a list similar to that shown below. Conclusion Configuring something for the first time is always confusing; ODBC is no different. Once you get by the common errors like misspelled password and actually get a DSN to connect, you'll see just how easy it is to set one of these up. You'll find ODBC drivers will allow you expand your options when it comes to which database tools you use. If you're database is web based, you'll no longer be bound to server specified tools like phpmyadmin but can use application that match your needs. - The Genie -
News ||
Reviews ||
Utilities ||
Home/Office ||
Web Tools ||
Web Utils ||
Graphics ||
Security ||
Games ||
Other Categories ||
Program List ||
FAQ ||
Forum ||
About Us ||
Contact Us ||
Home
Strategy Games || Action Games || Puzzle Games || Card Games |
|
|
|
|
|
|
|
|
|