To configure a database link
- To configure a file-based database link:
- Click
Home tab Project panel File Options
.
- In the
File Options dialog box,
DataTools tab, click the link you want to configure in the
DataTools Links area, and click the
Edit button.
Note: If you haven't added any links yet, click the
New button, and follow the procedure for adding database links first.
- To configure a global database link:
- Click
Home tab Tools panel DataTools
.
- In the
DataTools dialog box, click the link you want to configure in the
DataTools Links area, and click the
Edit button.
Note: If you haven't added any links yet, click the
New button, and follow the procedure for adding database links first.
- Configure the ODBC Driver:
- In the
Edit Link dialog box, select the appropriate ODBC Driver to define the type of the database to link to, for example Microsoft Access Driver (*.mdb).
- Click the
Setup button. The driver wizard opens, and guides you through the setup options. If you have difficulties setting up your connection details, contact your database administrator. When you finish, the box underneath will show the connection string. This string can be modified, if necessary.
For example, if you want to select a database with a certain name (say, test.mdb) that is always next to the model file (as in the resultant NWD/NWF not the original), type in:
DBQ=%pushpath(%poppath(%currentpath),"test.mdb"); DRIVER={Microsoft Access Driver (*.mdb)};
If you want to select a database with the same name as the original model file (say, AutoPlant), type in:
DBQ=%join(%removeext(%removepath(%sourcepath)),".mdb"); DRIVER={Microsoft Access Driver (*.mdb)};
- Select the
Hold Open for Application Lifetime check box, if you want to keep the database link open until you exit
Autodesk Navisworks.
- Specify which table in the database to query:
In the
SQL String field, click after
SELECT, and enter the selection statement, for example:
SELECT * FROM BoilerData WHERE "NWUniqueID" = %prop("Entity Handle", "Value");
This statement instructs
Autodesk Navisworks to select all columns from the
BoilerData table, whilst requiring that the column called
NWUniqueID matches a category/property pair called
Entity Handle/Value.
- Select which columns you want to display as link categories on the
Properties window:
- Double-click the
Fields Name field, and type the exact name of the database column, for example: “Part-time”.
- Press ENTER.
The
Display Name is automatically completed for you, but you can click it, and enter a different name, if you want. The text entered here is the category name shown on the link tab of the Properties window.
- Repeat the above process to list all required categories in the
Fields area of the dialog box.
- Click OK.
Attention: The model is not linked to the external data source until you have activated the database link.