Creating a Data Link to an ODBC Source

You can link data from a number of data sources to an AutoCAD Architecture drawing. You can use the following database providers for linking to data sources:

  • Microsoft Jet 4.0 OLE DB Provider (Access)
  • Microsoft OLE DB Provider for ODBC Drivers

These database providers let you link to the following data sources:

  • Microsoft Access database (MDB)
  • Microsoft Excel file (XLS)
  • Microsoft Text file (TXT, CSV)
NoteThe instruction below describes the process of creating a link to a data source from a Microsoft Excel file. In the same way, can create data links to Microsoft Access databases, plain ASCII text files, and comma-separated files.
  1. Open the Field dialog box from one of the following components:
    If you want to… Then…
    insert a database field into a text element see Inserting Fields in AutoCAD Text Elements.
    insert a database field into an multiline text (mtext) element see Inserting Fields in AutoCAD Multiline Text.
    insert a database field into an AutoCAD table cell see Inserting Fields in AutoCAD Table Cells.
    insert a database field into an attribute definition see Inserting Fields in AutoCAD Attributes.
    insert a database field into a property set definition see Inserting Fields in Property Set Definitions.
    insert a database field into an object property see Inserting Field Placeholders in Object Properties.
    insert a database field into an object style see Adding Fields to Object Style Properties.
  2. Under Field Category, select AEC Database.

  3. Under Field Names, select DatabaseField.
  4. Click one of the following buttons:
    Button Description
    Use this button if you want to create a new UDL link on a 32-bit computer.
    Use this button if you are working on a 64-bit computer, but want to create a link to a 32-bit data source.
    Use this button if you are working on a 64-bit computer, and want to create a link to a 64-bit data source.
  5. Click the Provider tab.

  1. Select Microsoft OLE DB Provider for ODBC Drivers, and click Next.
  2. In the Connection tab, click Use connection string.

  3. Click Build.

  4. Click New to build to a new DSN file.

  5. In the Create New Data Source dialog box, select the Microsoft Excel Driver (*.xls).
    NoteThe other supported drivers here are Microsoft Access Driver (*.mdb) and Microsoft Text Driver (*.txt, *.csv). You can use these to create a link to an Access database, a plain ASCII text file, or a comma-separated file.
  6. Click Next.

  7. Enter a name for the new DSN file, and click Next.
  8. Confirm that your data source settings are correct, and click Finish.

  9. In the ODBC Microsoft Excel Setup dialog box, select the version of Microsoft Excel that the DSN file should support.
  10. Click Select Workbook.

  11. Select an XLS file that should be used as your data source, and click OK three times until you are back in the Connection tab of the Data Link Properties dialog box.

    The Microsoft Excel file you have selected as your data source is displayed under Connection String.

  12. To verify that the connection to the data source is working correctly, click Test Connection.
  13. Enter a user name and optionally a password for the database connection.
  14. Under Enter the initial catalog to use, select the Excel file from the drop-down list.
  15. Optionally, you can click the Advanced tab to define network and permission settings.
  16. If you have selected a data source on a network server, you can define the network settings.
  17. Define the access permissions for the data source.
  18. Optionally, you can click the All tab to view and edit the OLE DB initialization properties available for the selected OLE DB provider.
  19. Click OK.
  20. In the Field dialog box, the selected Excel file is displayed as the data source.

    You can select data tables and entries as described in Selecting a Database Field.