ODBC Compatibility - Excel

Required knowledge before using ODBC in Vectorworks:

Vectorworks 2011 introduced the ability to use an ODBC (Open Database Connectivity) interface to communicate with external databases. To use this functionality; ODBC drivers and an ODBC manager are required.

Windows:

There is an integrated ODBC manager and the ‘Microsoft ODBC Driver Pack’ is available with the OS. To use databases like FileMaker Pro, MySQL, Oracle, FoxPro, etc., additional driver packages must be installed. The ODBC manager is available in Control Panel\Administrative Tools\ and it is called ‘Data Sources (ODBC)’. Take into consideration that in 64bit Windows there are two applications – one 32bit and one 64bit. They work with different ODBC drivers. The ‘Microsoft ODBC Driver Pack’ is not available in 64bit version and by default the list of drivers is empty. So, use the 32bit version of the ODBC manager for common purposes.

The 32bit version is located at \Windows\System32\odbcad32.exe and the 64bit version is located at \Windows\System32\odbcad32.exe.


Mac OSX:

There is no integrated ODBC manager, nor drivers. Additional packages must be installed. Here is an article about ODBC drivers and managers: http://kbase.vectorworks.net/questions/858/ODBC+Driver+Information 

Before you start using Vectorworks a DSNs (Data Source Name) must be created. It is the name that applications use to request a connection to an ODBC Data Source. In other words, it is a symbolic name that represents the ODBC connection. It stores the connection details like database name, directory, database driver, UserID, password, etc. when making a connection to the ODBC.

There are various types of ODBC Data Source Types such as System DSN, User DSN, FIle DSN. The differences between is in the store location and user privileges. Some drivers may not support all types of DSN, so be careful when create one.

On Mac some keywords Establishing ODBC connection in Vectorworks consists of three steps:

1) Connect to DSN: Tools > Database > Manage Databases. On Macintosh use username ‘admin’ with no password if you don’t have one.

2) Create Record Format Database Connection: Tools > Database > Create Record Format Connection.

3) Create Object Database Connection: Tools > Database > Object Connection.


Windows - Using ODBC to connect to Excel files:

For purposes of this article a sample file ‘TestExcel.xls’ was created with a sample table in Sheet1:

 odbc excel win1.png

Start 32bit version of ODBC Administrator, located at \Windows\SysWOW64\odbcad32.exe. On the ‘System DSN’ tab click on ‘Add…’ and a dialog ‘Create New Data Source’ will open. Choose ‘Microsoft Excel Driver (*.xls)’ or ‘Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)’ and click ‘Finish’. A dialog will open and enter Data Source Name, e.g. ‘Excel test’, select the workbook. Select the version of the file (Excel 97-2000 in our case) and make sure that the ‘Read Only’ check box is unchecked and click OK.

 odbc excel win2.png

Close the ODBC Administrator with OK. Start Vectorworks and go to Tools > Database > Manage Databases. Click on Connect button and choose the DSN ‘Excel test’ from the popup. Close the dialog with OK and the connection is established. Workbook sheets are visible as database tables. Mark a column as a key and close the dialog with OK.

 odbc excel win3.png

Create the following record format and map its fields to the database columns:

 odbc excel win4.png

Close the dialog with OK and draw a rectangle. Go to data pane in the OIP and attach record Space to it. Go to Tools > Database > Object Connection and select a row from the table:

 odbc excel win5.png

Close the dialog with OK and execute Tools > Database > Update Vectorworks Document and look at the data pane. The record instance is updated. Use Tools > Database > Update External Database to update data in the external database.

 odbc excel win6.png

Mac OSX - Using ODBC to connect to Excel files:

Additional driver is required for usage of excel files on Macintosh. For purposes of this article FileMaker Pro, FileMaker ODBC driver and ODBC Manager are used. Sample file ‘TestExcel.xls’ was created with a sample table in Sheet1:

 odbc excel mac1.png

Start FileMaker Pro and open the sample file. In 'Specify Excel Data' dialog choose 'Display worksheets' radio, select Sheet1 and click Continue. On the next dialog choose 'Field names' radio and click OK. Choose destination folder to save the converted file and save 'TestExcel Converted.fp7'. Go to menu File > Sharing > ODBC\JDBC and turn on ODBC\JDBC Sharing for this file and close the dialog with OK. Do not close anything. Start ODBC Manager and on System DSN tab click 'Add' and choose FileMaker ODBC driver. Click on OK and a wizard will start. Follow steps and enter a name for data source 'Excel Test', enter the IP of the host (use 'localhost' if the FileMaker is running on the same machine), turn on 'Connect to host to obtain the names of available databases.' and select the database 'TestExcel Converted'. Close the ODBC manager with OK and start Vectorworks. Go to Tools > Database > Manage Databases. Click on Connect button and choose the DSN ‘Excel Test’ from the popup. Enter username 'admin' if you don't use other and click OK. The connection is established. Mark a column as a key and close the dialog with OK.

 odbc excel mac2.png

Create the following record format and map its fields to the database columns:

odbc excel mac3.png 

 

Close the dialog with OK and draw a rectangle. Go to data pane in the OIP and attach record Space to it. Go to Tools > Database > Object Connection and select a row from the table:

 odbc excel mac4.png

Close the dialog with OK and execute Tools > Database > Update Vectorworks Document and look at the data pane. The record instance is updated. Use Tools > Database > Update External Database to update data in the external database.

odbc excel mac5.png 

 



Related Articles

Attachments

No attachments were found.

Visitor Comments

Would you like to...

Print this page  Print this page

Email this page  Email this page

Post a comment  Post a comment

Remove Highlighting Remove Highlighting

Edit this Article

Quick Edit

Export to PDF



Bookmark and Share

User Opinions

100% thumbs up 0% thumbs down (4 votes)

How would you rate this answer?




Thank you for rating this answer.

Continue