Database Connection Palette
(Available in Platinum)
Default UI Menu: Tools/Palette/Database Connect
Ribbon UI Menu:
TurboCAD has the ability to connect to a database and associate the data with objects. Database connectivity and management is handled through the Database Connection Palette.
To Create a Database Connection:
- Open the Database Connection Palette.
- Right click on the DataSources icon and click Add DataSource.
- In the Add Datasource dialog type in the name of the new datasource and click OK.
-
The Data Link Properties dialog will open.
-
On the Provider page select the appropriate OLE DB Provider type for the datasource to which you wish to connect. Then click Next.
- The Connection page will appear.
-
Specify the database source. or
-
Use connection String
1. Click Build
2. Select a File Data Source or Machine Data Source
3. Set login info if needed, then press OK.
4. Select the Database.
-
Setup the Server login information.
-
Click the Test Connection button. If the connection is valid the Test Connection Succeeded message will appear.
-
At this point you can move on to the Advanced and All pages, or click OK.
-
The features and functions of the Advanced and All pages are network and database specific, and are dependent upon your network and OBDC/OLE DB protocols. Only a person and experienced with your network and database protocols should alter these settings.
- After these operations you will see a new datasource object in DataSources tree.
- The datasource is not yet connected. Right-click on the datasource and select Connect.
-
Your database is now connected to TurboCAD as a datasource.
-
When connected a datasource shows all available tables and views in database.
To Disconnect a Datasource:
-
Select a connected datasource in the DataSources tree.
-
Right-click on the datasource and select Disconnect.
To Re-configure a Datasource:
-
Select a datasource in the DataSources tree.
-
Right-click on the datasource and select Configure. This will open the Data Link Properties dialog.
- Make the required changes and click OK.
To Remove a Datasource:
-
Select a datasource in the DataSources tree.
-
Right-click on the datasource and select Remove DataSource.
-
You will be prompted with a warning dialog.
-
If you are clear to proceed click Yes.
To Export a Datasource:
-
Select a datasource in the DataSources tree.
-
Right-click on the datasource and select Export DataSource.
- This will open Save As dialog.
- Select a location and name for the datasource, and then click Save.
To Import a Datasource:
- Right click on the DataSources icon and click Import DataSource.
- This will start the Open dialog.
Note: Connect is only available when a datasource is disconnected. Disconnect is only available when a datasource is connected.
Creating Data Link Templates
In order to connect data from tables to graphic objects it is necessary to create Link Templates. Link templates set a pattern that defines which the data elements will be linked from the table and associated with designated graphic objects. To Create a New Link Template:
- Select a table in the DataSources tree.
- Right-click and select New Link Template, or click the . The New Link Template dialog will appear.
- Type in a name for the link template, and then click OK.
-
The Link Template Edit dialog will appear.
-
Select the Key Columns. These are used to define link information data for linked graphics.
-
Select the Value Columns. These values will be set as custom properties of the object.
-
The created link template will be attached to current active drawing.
To Edit a Link Template:
- Select the template in the DataSources tree.
- Right-click and select Edit. The Link Template Edit dialog will appear.
- Make the required changes, and then click OK.
To Remove a Link Template:
-
Select the template in the DataSources tree.
-
Right-click and select Delete.
Warning: The link template will be immediately deleted. Removing a link template leads to removing all graphic links bound to it.
- You will be prompted to confirm the deletion.
Linking Data to Graphics
Data is linked to graphics by connecting a table to specific graphics via link templates. To Connect Data to Graphics:
- In a drawing, select one or more graphics.
- In the DataSources tree, double click on the desired table to select it for linking. This will also open the view of the table in the lower frame of the palette.
- In the table view, in the lower frame of the palette, click on the record you wish link.
- Use the Link Template drop-down box located on the palette toolbar to select the desired link template.
- Click the Create Link button on palette toolbar.
-
The link between the selected graphics and the table record is created.
-
Go to the Custom Properties of the object to verify the link.
Synchronizing Data and Graphics
To get data into linked graphics it is necessary to synchronize the data. The synchronizing process copies data from the datasource into all linked graphics and places it in the custom properties of linked graphics. To Synchronize Data:
- Click the Synchronize Data button on toolbar to run synchronizing process.
- Verify that the data has been synchronized by opening the properties of a graphic that is linked and going to the Custom page.
To Remove Links from Selected Graphics:
-
Select the graphic/s you wish to de-link.
-
In the DataSources tree select the link template you wish to de-link from the graphic/s.
- Right-click and select Delete Links(Sel).
-
Synchronize the data.
-
The links and data have been removed.
To Remove All Links to a Link Template:
- In the DataSources tree select the link template you wish to de-link.
- Right-click and select Delete All Links.
-
Synchronize the data.
-
The links and data have been removed.
To Find Graphics Linked to the Datasource:
-
Select the datasource.
-
Click the View linked objects in drawing button on palette's toolbar.
-
Right-click and select Find Graphics.
To Find Table Record Linked to a Selected Graphics:
-
Select a graphic.
-
Click the View linked records in dataview button on palette's toolbar.
- All records which are linked to the selected object will be highlighted in the table view.
Viewing and Editing Data in Tables
When connected a datasource shows all available tables and views in database. Available tables and views appear as child nodes of the datasource.
To Show a Table's Content:
- Select the table in the DataSources tree.
- Right-click and select View Table, the table will be opened in the lower frame of the Data base Connection palette in Read-Only mode.
To Edit a Table's Content:
- Select the table in the DataSources tree.
- Right-click and select Edit Table, the table will be opened in the lower frame of the Data Base Connection palette in Edit mode.