43
ODBC Connectivity in Vectorworks

ODBC Connectivity in Vectorworks

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: ODBC Connectivity in Vectorworks

ODBC Connectivity in Vectorworks

Page 2: ODBC Connectivity in Vectorworks

2 | Vectorworks ODBC Connectivity in Vectorworks

Contents

Speaking in general about ODBC, required knowledge before start using ODBC in Vectorworks ......... 1

How to use ODBC to connect to Access files on Windows ......................................................................... 2

How to use ODBC to connect to Access files on Macintosh ....................................................................... 6

How to use ODBC to connect to Excel files on Windows ............................................................................ 9

How to use ODBC to connect to Excel files on Macintosh ........................................................................ 12

How to use ODBC to connect to Microsoft SQL Server (MSSQL) database on Windows ...................... 15

How to use ODBC to connect to Microsoft SQL Server (MSSQL) database on Macintosh .................... 19

How to use ODBC to connect to MySQL database on Windows ............................................................... 23

How to use ODBC to connect to MySQL database on Macintosh............................................................. 27

How to use ODBC to connect to FileMaker Pro files on Windows ............................................................ 32

How to use ODBC to connect to FileMaker Pro files on Macintosh .......................................................... 36

How to install SQLite, create a test table and connect to it on Windows ................................................. 40

How to install SQLite, create a test table and connect to it on Macintosh ............................................... 47

Page 3: ODBC Connectivity in Vectorworks

3 | Vectorworks ODBC Connectivity in Vectorworks

Speaking in general about ODBC, required knowledge before start using ODBC in Vectorworks

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

On Windows, there is 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 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.

On Macintosh, 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 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.

How to use ODBC to connect to Access files on WindowsFor purposes of this article a sample file ‘TestAccess.accdb’ was created with a table ‘Spaces’:

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 Access Driver (*.mdb)’ or ‘Microsoft Access Driver (*.mdb, *.accdb)’

Page 4: ODBC Connectivity in Vectorworks

4 | Vectorworks ODBC Connectivity in Vectorworks

and click ‘Finish’. A dialog will open and enter Data Source Name, e.g. ‘Access test’, select the database file, make sure that the ‘Read Only’ check box is unchecked and click OK.

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

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

Page 5: ODBC Connectivity in Vectorworks

5 | Vectorworks ODBC Connectivity in Vectorworks

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

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.

Page 6: ODBC Connectivity in Vectorworks

6 | Vectorworks ODBC Connectivity in Vectorworks

How to use ODBC to connect to Access files on MacintoshAdditional driver is required for usage of access files on Macintosh. For purposes of this article Actual Access ODBC Driver and ODBC Manager are used. Sample file ‘TestAccess.accdb’ was created with a table ‘Spaces’:

Start ODBC Manager and on the ‘System DSN’ tab click ‘Add…’ and choose driver Actual Access. A wizard will start and during steps enter a name for the data source, e.g. ‘Access Test’, select the database file and complete wizard.

Start Vectorworks and go to Tools > Database > Manage Databases. Click on Connect button and choose the DSN ‘Access Test’ from the popup. Enter username ‘admin’ if you don’t have one and close the dialog with OK. The connection is established. Mark a column as a key and close the dialog with OK.

Page 7: ODBC Connectivity in Vectorworks

7 | Vectorworks ODBC Connectivity in Vectorworks

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

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:

Page 8: ODBC Connectivity in Vectorworks

8 | Vectorworks ODBC Connectivity in Vectorworks

Close the dialog with OK and execute Tools > Database > Update Vectorworks Document and look at the data pane. The record instance is updated.

Page 9: ODBC Connectivity in Vectorworks

9 | Vectorworks ODBC Connectivity in Vectorworks

How to use ODBC to connect to Excel files on WindowsFor purposes of this article a sample file ‘TestExcel.xls’ was created with a sample table in Sheet1:

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.

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.

Page 10: ODBC Connectivity in Vectorworks

10 | Vectorworks ODBC Connectivity in Vectorworks

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

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:

Page 11: ODBC Connectivity in Vectorworks

11 | Vectorworks ODBC Connectivity in Vectorworks

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.

Page 12: ODBC Connectivity in Vectorworks

12 | Vectorworks ODBC Connectivity in Vectorworks

How to use ODBC to connect to Excel files on MacintoshAdditional 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:

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.

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

Page 13: ODBC Connectivity in Vectorworks

13 | Vectorworks ODBC Connectivity in Vectorworks

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:

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.

Page 14: ODBC Connectivity in Vectorworks

14 | Vectorworks ODBC Connectivity in Vectorworks

How to use ODBC to connect to Microsoft SQL Server (MSSQL) database on WindowsMicrosoft SQL Server is required, screen shots in the article are made using MSSQL Server 2008 with sample table called ‘New Table:

Start ODBC Administrator:

- 32bit version: \Windows\SysWOW64\odbcad32.exe;

- 64bit versiom: \Windows\System32\odbcad32.exe.

On the ‘System DSN’ tab click on ‘Add…’ and a dialog ‘Create New Data Source’ will open. Choose ‘SQL Server’ and click ‘Finish’. A

Page 15: ODBC Connectivity in Vectorworks

15 | Vectorworks ODBC Connectivity in Vectorworks

wizard will start and enter a name for the data source, e.g. ‘SQL Test’ and enter the server name and the machine where it is located.

Click Next, choose the authentication mode, click Next and change the default database and finish the wizard.

Close the ODBC Administrator with OK. Start Vectorworks and go to Tools > Database > Manage Databases. Click on Connect button and choose the DSN ‘SQL Test’ from the popup. Close the dialog with OK and the connection is established. Mark a column as a key and close the dialog with OK.

Page 16: ODBC Connectivity in Vectorworks

16 | Vectorworks ODBC Connectivity in Vectorworks

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

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:

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.

Page 17: ODBC Connectivity in Vectorworks

17 | Vectorworks ODBC Connectivity in Vectorworks

How to use ODBC to connect to Microsoft SQL Server (MSSQL) database on MacintoshMicrosoft SQL Server is required, installed on machine in the network. Additional SQL driver and ODBC Manager are required also, For purposes of this demo MSSQL Server 2008 is running on machine with address 192.168.180.45 and a sample database ‘Test’ with one table called ‘Spaces’ are created. On Mac is installed Actual SQL Driver.

Start ODBC Manager and on the ‘System DSN’ tab click on ‘Add…’ and choose ‘Actual SQL Server’ driver. Click OK and a wizard will start. Enter name for data source, e.g. ‘SQL Test’, server address and name, choose type if the database (in our case Microsoft SQL Server) , turn on ‘Connect to SQL Server’ and set the default base to ‘Test’. Finish the wizard.

Page 18: ODBC Connectivity in Vectorworks

18 | Vectorworks ODBC Connectivity in Vectorworks

Start Vectorworks and go to Tools > Database > Manage Databases. Click on Connect button and choose the DSN ‘SQL Test’ from the popup. Enter user name with the domain name and password is it is required and close the dialog with OK.

and the connection is established. Mark a column as a key and close the dialog with OK.

Page 19: ODBC Connectivity in Vectorworks

19 | Vectorworks ODBC Connectivity in Vectorworks

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

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:

Page 20: ODBC Connectivity in Vectorworks

20 | Vectorworks ODBC Connectivity in Vectorworks

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.

Page 21: ODBC Connectivity in Vectorworks

21 | Vectorworks ODBC Connectivity in Vectorworks

How to use ODBC to connect to MySQL database on WindowsMySQL server and MySQL driver are required. For purposes of this article a sample database ‘test’ was created with one table ‘testdatabase’:

Start ODBC Administrator:

- 32bit version: \Windows\SysWOW64\odbcad32.exe;

- 64bit versiom: \Windows\System32\odbcad32.exe.

On the ‘System DSN’ tab click on ‘Add…’ and a dialog ‘Create New Data Source’ will open. Choose ‘MySQL ODBC 5.1 Driver’ or other version of MySQL Driver and click ‘Finish’. A dialog will open and enter Data Source Name, e.g. ‘MySQL Test’, enter the IP of the server. If the server is localhost, enter 127.0.0.1 and port 3306. Select the database ‘test’ and test the connection.

If the test succeeded close the dialog and ODBC Administrator with OK. Start Vectorworks and go to Tools > Database > Manage Databases. Click on Connect button and choose the DSN ‘MySQL Test’ from the popup. Close the dialog with OK and the connection

Page 22: ODBC Connectivity in Vectorworks

22 | Vectorworks ODBC Connectivity in Vectorworks

is established. Mark a column as a key and close the dialog with OK.

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

Page 23: ODBC Connectivity in Vectorworks

23 | Vectorworks ODBC Connectivity in Vectorworks

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:

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.

Page 24: ODBC Connectivity in Vectorworks

24 | Vectorworks ODBC Connectivity in Vectorworks

How to use ODBC to connect to MySQL database on MacintoshMySQL server and MySQL driver are required. For purposes of this article MySQL server is running on remote machine with address 192.168.180.45 in the network. A sample database ‘test’ was created with one table ‘testdatabase’:

Of you need to install MySQL Driver on MacOS download and install http://mirrors.cogentco.com/pub/mysql/Connector-ODBC/5.1/mysql-connector-odbc-5.1.7-osx10.6-x86-32bit.dmg. Start ODBC Manager and go to Drivers tab. If there isn’t MySQL ODBC 5.1 Driver click on ‘Add...’ and type driver name ‘MySQL ODBC Driver 5.1 Driver’, type in ‘Driver File’ field /usr/local/lib/libmyodbc5.so and for ‘Setup File’ /usr/local/lib/libmyodbc3S.so. Close the dialog with OK.

To create a DSN start ODBC Manager and on System DSN click ‘Add...’, choose MySQL ODBC 5.1 Driver and click OK. If ‘Connector/ODBC’ dialog appear type data source name, e.g. ‘MySQL Test’, server 192.168.180.45 in our case, 127.0.0.1 for localhost, user and password and the database you are going to use. In our case ‘test’. Test the connection and if it is successful close the dialog with OK.

Page 25: ODBC Connectivity in Vectorworks

25 | Vectorworks ODBC Connectivity in Vectorworks

If a standard dialog appears type a name for the datasource, e.g. ‘MySQL Test’ and add the following keywords:

SERVER=<server_ip_address> (in our case 192.168.180.45, 127.0.0.1 for localhost)

PORT=3306

DATABASE=<name_of_db> (in our case ‘test’)

Close the dialog with OK and start Vectorworks. Go to Tools > Database > Manage Databases. Click on Connect button and choose the DSN ‘MySQL Test’ from the popup, enter username and password. Close the dialog with OK and the connection is established. Mark a column as a key and close the dialog with OK.

Page 26: ODBC Connectivity in Vectorworks

26 | Vectorworks ODBC Connectivity in Vectorworks

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

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:

Page 27: ODBC Connectivity in Vectorworks

27 | Vectorworks ODBC Connectivity in Vectorworks

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.

Page 28: ODBC Connectivity in Vectorworks

28 | Vectorworks ODBC Connectivity in Vectorworks

How to use ODBC to connect to FileMaker Pro files on WindowsFileMaker Pro software and FileMaker ODBC driver are required. For purposes of this article a sample file ‘TestDatabase.fp7’ was created with a sample table:

Start FileMaker Pro and open the file. Go to File > Sharing > ODBC/JDBC and turn on ODBC/JDBC Sharing for this file. Close the dialog with OK and do not close anything. 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 ‘FileMaker ODBC’ and click ‘Fin-ish’. A wizard will start. Follow it and during steps enter a name for the data source, e.g. ‘FM Test’, enter the IP of the machine, where the FileMaker is running (‘localhost’ if the application is running on the same machine). Turn on ‘Connect to host to obtain the names of available databases’, select the Database and finish the wizard.

Close the ODBC Administrator with OK. Start Vectorworks and go to Tools > Database > Manage Databases. Click on Connect button and choose the DSN ‘FM Test’ from the popup, use ‘admin’ as username if you don’t use something else and close the dialog with OK. The connection is established. Mark a column as a key and close the dialog with OK.

Page 29: ODBC Connectivity in Vectorworks

29 | Vectorworks ODBC Connectivity in Vectorworks

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

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:

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.

Page 30: ODBC Connectivity in Vectorworks

30 | Vectorworks ODBC Connectivity in Vectorworks

How to use ODBC to connect to FileMaker Pro files on MacintoshFileMaker Pro software, FileMaker ODBC driver and ODBC Manager are required. For purposes of this article a sample file ‘TestDatabase.fp7’ was created with a sample table:

Page 31: ODBC Connectivity in Vectorworks

31 | Vectorworks ODBC Connectivity in Vectorworks

Start FileMaker Pro and open the file. Go to File > Sharing > ODBC/JDBC and turn on ODBC/JDBC Sharing for this file. Close the dialog with OK and do not close anything. Start ODBC Manager and on System DSN click Add. Choose FileMaker ODBC driver from the list and click OK. A wizard will start and following steps enter name for the data source, e.g. ‘FM Test’, enter the IP of the machine where FileMaker is running (write ‘local’ if the machine is the current machine) as Host and turn on ‘Connect to host to obtain the names of available databases.’. Then select the database ‘TestDatabase’ and finish the wizard.

Start Vectorworks and go to Tools > Database > Manage Databases. Click on Connect button and choose the DSN ‘FM Test’ from the popup, use ‘admin’ as username if you don’t use something else and close the dialog with OK. The connection is established. Mark a column as a key and close the dialog with OK.

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

Page 32: ODBC Connectivity in Vectorworks

32 | Vectorworks ODBC Connectivity in Vectorworks

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:

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.

Page 33: ODBC Connectivity in Vectorworks

33 | Vectorworks ODBC Connectivity in Vectorworks

How to install SQLite, create a test table and connect to it on WindowsGo to SQLite download page(http://www.sqlite.org/download.html) and find section ‘Precompiled Binaries for Windows’. Download sqlite-dll-win32-x86-*.zip and sqlite-shell-win32-x86-*.zip. For the purposes of this article we use SQLite version 3.8.2.

Create a folder C:\sqlite3 and extract the two archives there. You must have three files there: sqlite3.def, sqlite3.dll, sqlite3.exe.

Page 34: ODBC Connectivity in Vectorworks

34 | Vectorworks ODBC Connectivity in Vectorworks

Sqlite3.exe is a simple command-line utility that allows the user to manually enter and execute SQL statements against a SQLite database.

Now we have to make Windows to use the SQLite library. There are two ways to do this. First option is to add the path c:\sqlite3 to your PATH environment variable. The second way is to move the three files to your System32 folder (usually c:\Windows\System32\).

Run Command prompt and type sqlite3. You should receive a result like this one:

c:\>sqlite3

SQLite version 3.8.2 2013-12-06 14:53:30

Enter “.help” for instructions

Enter SQL statements terminated with a “;”

sqlite>

Now you are ready to create a sample database. Exit from here with command

sqlite> .quit

and close the Command prompt with exit command.

Test files will be stored in c:\sqlite3\. Run Command prompt there and type the following commands:

Page 35: ODBC Connectivity in Vectorworks

35 | Vectorworks ODBC Connectivity in Vectorworks

sqlite3 test.db

sqlite> .databases

The result should be:

Create sample table:

sqlite> create table Circles (ID integer, Name varchar(10));

sqlite> insert into Circles values (1, ‘Blue’);

sqlite> insert into Circles values (2, ‘Red’);

To check records enter command:

sqlite> select * from Circles;

Page 36: ODBC Connectivity in Vectorworks

36 | Vectorworks ODBC Connectivity in Vectorworks

To connect Vectorworks to the table created above start Vectorworks and go to Tools > Database > Manage Databases.

Select ‘Use SQLite File’ radio button and select file C:\sqlite3\test.db and close the dialog with OK.

Mark a column as a key and close the dialog with OK.

Page 37: ODBC Connectivity in Vectorworks

37 | Vectorworks ODBC Connectivity in Vectorworks

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

Click on ‘Connection Options’ button and turn off the two options.

Page 38: ODBC Connectivity in Vectorworks

38 | Vectorworks ODBC Connectivity in Vectorworks

Close both dialogs with OK and draw a circle. Go to data pane in the OIP and attach record Circle to it. Go to Tools > Database > Object Connection and select a row from the table:

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.

Page 39: ODBC Connectivity in Vectorworks

39 | Vectorworks ODBC Connectivity in Vectorworks

How to install SQLite, create a test table and connect to it on MacintoshGo to SQLite download page(http://www.sqlite.org/download.html) and find section ‘Source Code’. Download sqlite-autoconf-*.tar.gz. For the purposes of this article we use SQLite version 3.8.2. Run Terminal and execute the following commands to install the SQLite:

$tar xvfz sqlite-autoconf-3080200.tar.gz

$cd sqlite-autoconf-3080200

$./configure --prefix=/usr/local

$make

$make install

To verify installation execute command

$sqlite3

and the result should be:

Now you are ready to create a sample database. Exit from here with command:

sqlite> .quit

Page 40: ODBC Connectivity in Vectorworks

40 | Vectorworks ODBC Connectivity in Vectorworks

Create folder /sqlite3 and navigate Terminal there and execute the following commands:

sqlite3 test.db

sqlite> .databases

The result should be:

Create sample table:

sqlite> create table Circles (ID integer, Name varchar(10));

sqlite> insert into Circles values (1, ‘Blue’);

sqlite> insert into Circles values (2, ‘Red’);

To check records enter command:

sqlite> select * from Circles;

Page 41: ODBC Connectivity in Vectorworks

41 | Vectorworks ODBC Connectivity in Vectorworks

To connect Vectorworks to the table created above start Vectorworks and go to Tools > Database > Manage Databases.

Select ‘Use SQLite File’ radio button and select file C:\sqlite3\test.db and close the dialog with OK.

Mark a column as a key and close the dialog with OK.

Page 42: ODBC Connectivity in Vectorworks

42 | Vectorworks ODBC Connectivity in Vectorworks

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

Click on ‘Connection Options’ button and turn off the two options.

Page 43: ODBC Connectivity in Vectorworks

43 | Vectorworks ODBC Connectivity in Vectorworks

Close both dialogs with OK and draw a circle. Go to data pane in the OIP and attach record Circle to it. Go to Tools > Database > Object Connection and select a row from the table:

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.