25.3 Linking AutoCAD to the Database - the dbConnect Manager

 < Day Day Up > 



25.2 Configuring Your Operating System to Share the Database

Of course, you can use OLE to include a database in your drawing just as we linked to the Excel spreadsheet in Lesson 24. But using OLE, you can't link each record to a specific AutoCAD object in the drawing. This remarkable procedure helps you keep track of which objects have been listed in the database, which have not, and objects that are listed in the database that are no longer in the drawing. (Reread the last three sentences several times. They're the keys to this entire lesson and the reason why AutoCAD invented dbConnect.)

Unlike OLE, however, you'll soon discover that the application used to create the database doesn't have to be on the computer. AutoCAD took a cue from Microsoft applications that connect to databases and include a jet – a database engine used to read/modify databases. Let's make that easier to understand: AutoCAD can read a database because it contains some programming (called a jet) that makes it possible.

The jet works on the AutoCAD side of the exchange of information between AutoCAD and the database. The database also contains a jet that works on its side. But you must tell your operating system (in our case, Windows) to allow the jets to share the same controls (to fly together like the Blue Angels). To do that, tell Windows to Open Database Connectivity between them. Use the ODBC Data Source Administrator (Figure 25.2a). (Details on how to do this are provided in Exercise 25.2.1.)

click to expand
Figure 25.2a

Access the ODBC Data Source Administrator via the Windows Control Panel.

Let's walk through the procedure together. For continuity, we'll use the same PID drawing we used in Lesson 19 and a database that we'll provide.

Note 

This is one of the scary parts of being an instructor. I'm about to show you how to change part of the configuration of your computer. Approach this section cautiously and be sure you understand what to do before you do it. This is a dangerous place to explore or experiment. Please restrict that activity to AutoCAD.

I'll use the Windows XP Operating System. Your icons and dialog boxes may vary if you use a different version of Windows, although the procedure varies little for Windows 98 and Me.

Do This: 25.2.1 Opening Database Connectivity

  1. Completely read through this exercise before beginning.

  2. After you've completed Step I above, follow these steps.

    TOOLS

    COMMAND SEQUENCE

    STEPS

    Command: exit

    1. Close AutoCAD.

    My Computer

     

    2. Double-click on the My Computer icon on your desktop. Windows opens the My Computer window.

    Control Panel

     

    3. Double-click on the Control Panel icon in the My Computer window. Windows opens the Control Panel window.

    Administrative Tools

     

    4. Double-click on the Administrative Tools icon in the Control Panel window. Windows opens the Administrative Tools window.

    Data Sources (ODBC)

     

    5. Double-click on the Data Sources (ODBC) icon in the Administrative Tools window. Windows presents the Open Data Source Administrator (Figure 25.2a).

     

    6. We must add our database as a data source. Begin by picking the Add button.

    click to expand

    7. Windows presents the Create New Data Source dialog box. Read through the list of available database drivers.

    I created our database using MS Access, so select that driver. (This tells Windows how the database file was created.)

    Pick the Finish button to continue.

    click to expand

    8. Windows presents the ODBC Microsoft Access Setup dialog box.

    Enter the name My_PID_Database in the Data Source Name text box.

    Next, we'll specify the actual database that we'll use. Pick the Select… button in the Database frame.

    click to expand

    9. Windows presents the Select Database dialog box.

    Select the pid25.mdb file in the C:\Steps\Lesson25 folder.

    Pick the OK button to continue.

    click to expand

    10. Notice that the database and path you just selected now appear in the Database frame of the ODBC Microsoft Access Setup dialog box.

    Pick the OK button again.

    click to expand

    11. Notice that your new source appears in the User Data Sources list box.

    Pick the OK button to complete the procedure.

Did you notice that I didn't explain all the tabs on the ODBC Data Source Administrator (and subsequent dialog boxes)? I know you've become accustomed to my explaining everything, but this isn't an AutoCAD dialog box. Simply reloading an application can't repair mistakes here. I must repeat: This is not an appropriate place for experimentation or exploration. Leave your computer's operating system to the experts.

Note 

Now that I've discouraged your experimentation, let me make a suggestion for those of you who must know more – regardless of the risk. Microsoft offers courses and certifications for all of its Windows products – including its operating systems. Check its web site for more details. Start at

http://www.microsoft.com/traincert/default.asp



 < Day Day Up > 



AutoCAD 2004. One Step at a Time
3D AutoCAD 2004/2005: One Step at a Time
ISBN: 0975261371
EAN: 2147483647
Year: 2003
Pages: 96

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net