Vous êtes sur la page 1sur 3

Attaching the database to the drawing file is the first step in making use of external data from within

AutoCAD Map 3D. In this drawing are parcel boundaries, which are just closed polylines; and also

parcel numbers, which you will use as the centroids. However, that information is not pertinent as you

perform the first step, which is to attach the database. Later, we will make use of this data to generate

the actual links to the records in that database.

When we work with databases, you will be doing most of the work in the Map Explorer tab of the Task

Pane. The Map Explorer tab shows any attached data including Drawings, Queries, Object Classes,

Data Sources, Topologies, and Link Templates. In this series of exercises, we will be working with

data sources and link templates. For data sources, there are a number of ways for us to attach the

databases, and you will learn all of those methods.

Right-click the Data Sources folder and click Attach. This opens the Attach Data Source dialog. By

default, we are taken directly to the data links folder. If we had universal data links set up, we would

see those here. Start off by attaching a Microsoft Access database file. For file types, select .mdb,

and then navigate to the location where we have your dataset stored. Select the file called "facility.

mdb," and click Attach.

If you receive an error message after clicking Attach that says something to the effect of "Failed to

create the data source file," stop this lesson and create a local DSN connection on your machine.

Now, under Data Sources, you can see the database that's attached, along with all of the tables in

the database. This is one way to attach a database to AutoCAD Map.

Let's look at another method to attach a database. First, select the facility Data Source, right-click and

click Detach. Click Yes to confirm this action.

Notice that when I select the Data Sources folder in the Map Explorer, the Data Source contextual tab

is displayed in the ribbon, which shows all of the database commands. These are the same

commands that I can access by right-clicking Data Sources in the Map Explorer tab.

To attach the database from the Data Source contextual tab, in the ribbon, Attach panel, click Attach

Data. This bring us back to the same Attach Data Source, and again, by default we start in the Data

Links folder. However, since we have already attached the facility database, AutoCAD Map
automatically created a .udl file. Switch the file type to .udl, and now we can use this file to reattach

the same database. The .udl file contains information about the database, such as where it is located,

as well as what driver is being used to attach it. This time, instead of browsing to the actual .mdb file,

select the facilities.udl file and click Attach. You can see again in the Map Explorer that we have

attached the same database.


The third way that we can attach a database to AutoCAD Map is to simply drag-and-drop the

database file directly into the Map Explorer. First, detach the facility database, and this time, bring up

the Windows Explorer, that has already been browsed to the folder that contains the database. From

here, simply drag the facilities.mdb file and drop it into the Map Explorer. You can see that the same

database has now been reattached using the drag-and-drop method.

So there are three ways to attach external databases to AutoCAD Map 3D. Once you have attached

the database, it's important that you save the drawing. This also saves the attachment to the database

and the next time you open this drawing, AutoCAD Map will reestablish the attachment to that

database.

Vous aimerez peut-être aussi