3D AutoCAD 2004/2005: One Step at a Time

 < Day Day Up > 


25.3 Linking AutoCAD to the Database – the dbConnect Manager

Now that your database's jet is available for flight (or in more down-to-earth terms, your computer has been set up so that the database can speak to AutoCAD), you must set up AutoCAD's jet so that it can fly with the database. Luckily, AutoCAD has provided the dbConnect Manager to assist you.

I'll introduce you to the dbConnect Manager in our next exercise. But I'll explain most of the details of dbConnect functionality over the course of the next few exercises.

Do This: 25.3.1 Connecting AutoCAD to the Data Source

  1. Open the pid25.dwg file in the C:\Steps\Lesson25 folder. The drawing looks like Figure 25.3.1a. (The bubbled letters will serve as valve identifiers throughout this lesson.)

    Figure 25.3.1a

  2. Follow these steps.

    TOOLS

    COMMAND SEQUENCE

    STEPS

    No Button Available

    Command: dbc

    1. Open the dbConnect Manager by typing dbconnect (or dbc) at the command prompt.

    2. The dbConnect Manager appears as a tool palette. (AutoCAD also produces a dbConnect pull-down menu.)

    Notice that the dbConnect Manager lists the name and path of the current drawing. Below the drawing, the dbConnect Manager lists Data Sources available for use. AutoCAD provides the dbsamples database for use with its tutorial. Ignore it for now.

    3. We must configure AutoCAD to use My_PID_Database. Begin by right-clicking on the Data Sources listing. Then pick Configure Data Source… on the cursor menu that appears. (An alternate procedure would be to use the dbConnect pull-down menu. Follow this path: dbConnect – Data Source – Configure… There is no command line method.)

    4. AutoCAD presents the Configure a Data Source dialog box (shown).

    Notice that AutoCAD already shows dbsamples as a data source. Remember, AutoCAD has already been configured to use this database.

    Also notice that the list box precedes dbsamples with jet_. This simply tells you which engine the dbsamples database requires.

    In the Data Source Name text box, enter the name of the database we'll use (precede it with the jet_ engine designation). You should enter jet_pid.

    Pick the OK button to continue.

    5. AutoCAD presents the Data Link Properties dialog box (shown). We begin by telling AutoCAD what type of data to which we'll connect on the Provider tab.

    Remember that we set up Windows to use an ODBC driver to share our pid database. Select that option.

    Pick the Next >> button (or the Connection tab) to continue.

    6. On the Connection tab, we give AutoCAD the ODBC information it'll need to make the connection.

    • Begin by selecting the data source name (DSN) we gave Windows in the Use data source name control box. (If the My_PID_Database DSN doesn't appear in the control box options, pick the Refresh button.)

      (If no DSN has been created, you can select the Use connection string – Build… button to set it up much as we did in our first exercise in this lesson.)

    • If the database requires User name and Password for access, you should place those in the appropriate boxes in Step 2. (Our database doesn't require these so leave these boxes blank.)

    • You can specify a file to use in Step 3. This isn't required unless the database is located outside the drawing's project search path (Files tab of the Options dialog box). We'll use it here to be sure we access the correct file.

    7. Pick the Test Connection button to verify that your setup has found the appropriate database.

    AutoCAD presents the Microsoft Data Link message box indicated. If the test connection doesn't succeed, cancel the process and return to Step 1. If the test connection is successful, pick the OK button to close the message box and again to complete the procedure.

      

    8. The dbConnect Manager now looks like Figure 25.3.1.8a.

     

    Figure 25.3.1.8a

     

Congratulations! You've linked AutoCAD to an MS Access database!

If you don't feel suitably impressed yet, consider that you've just connected your "drafting tool" to one of the most powerful informational tools (a database) ever devised by "mortal man."

Thanks to this ability (together with the ability to tie in to the Internet), you, as the project draftsman/designer, will acquire many new responsibilities (and achieve new status – hopefully with an accompanying raise in salary). You'll now take a greater hand in materials selection and management. In some cases, it even means more control over personnel and equipment assignments (see the exercises at the end of this lesson).

But now that you've tied into a database, what do you do with it? This is the topic of our next section.


 < Day Day Up > 

Категории