Configuring a Connection
SECTION 12 Databases
186
12-2-6 Creating a Read/Write connection to an Excel file
Connections to Excel files may result in the error "Operation must use an
updateable query". This is because the Provider installed with ADO version
2.0 is read only by default hence Records can not be added or amended. To
override this function you must manually change the Read Only property in the
Connection String. On the "Modify Connection" dialog box click "Advanced…"
and set the connection property as shown in the last line below:
Driver={Microsoft Excel Driver (*.xls)};
DBQ=C:\WorkBook.xls;
ReadOnly=False;
Excel files can also be updated by accessing the file via the ODBC DSN driver.
This is achieved by carrying out the following steps:
•
Create a File DSN for the required Excel file with the following options (see
Chapter 12, Creating a Data Source Name file)
•
Select the Microsoft Excel Driver (*.xls). If this option does not exist, you
will need to install the Microsoft ODBC driver for Excel from the Excel
setup.
•
Ensure that the "Read Only" check box is clear.
•
Load the Excel spreadsheet and create a table to access the data by
creating a Named Range as follows:
•
Highlight the row(s) and column(s) area where your data resides
(including the header row).
•
On the 'Insert' menu, point to 'Name', click 'Define' and enter a name for
your range.
•
Create a connection in the CX-Supervisor Workspace specifying the File
DSN as its source.
•
Add a Recordset to the connection and select the Named Range (which
will appear in the list of available tables, if the connection is live) as the
Table name. Records in this table can now be added or modified as with
any other database table (Note: If records are added to this type of table
the Named Range will increase in size accordingly automatically).
The example below demonstrates a valid range selection named:
"CustomerInvoice" (note the name displayed just above column A):
Note:
The first row of the range is assumed to contain the Column Headings.
Summary of Contents for CX-Supervisor
Page 1: ...CX Supervisor Software Cat No W10E EN 01 User Manual Software Release 3 1...
Page 3: ...Copyright Notice 2...
Page 16: ...15...
Page 17: ...16...
Page 27: ...Tip of the Day SECTION 1 Graphics Editor 26...
Page 35: ...CX Supervisor Preferences SECTION 2 Pages 34...
Page 79: ...Responding to Events SECTION 5 ActiveX Objects 78...
Page 115: ...Printing the Graphics Library SECTION 7 Graphics Library 114...
Page 181: ...Data Logging SECTION 11 Data Logging 180...
Page 201: ...Examples SECTION 12 Databases 200...
Page 243: ...Performance Monitor SECTION 16 Application Analysis Performance Monitor 242...
Page 253: ...Using with Omron s CX Server OPC SECTION 17 Using CX Supervisor as an OPC Cli 252...
Page 259: ...Creating a CX Supervisor Client application SECTION 18 Connecting to a remote CX 258...
Page 263: ...Adding a Point Linked to a Parameter SECTION 19 Connecting to Omron Industrial 262...
Page 271: ...Data Logging SECTION 20 Best Practices 270...
Page 275: ...Configuring a Server PC running Windows NT or 2000 Appendix A Configuring a PC 274...
Page 277: ...Appendix B Frequently Asked Questions 276...
Page 296: ...Appendix B Frequently Asked Questions 295...
Page 297: ...Appendix B Frequently Asked Questions 296...
Page 298: ...Appendix B Frequently Asked Questions 297...
Page 299: ...Appendix B Frequently Asked Questions 298...
Page 333: ...Revision history 332...