Industrial Automation
Industrial Automation | Europe

myKnowledge

Main > Product Type > Software > Visualisation
Minimize Text   Default    Enlarge Text
 

Print
E-mail

How Do I Connect CX-Supervisor To A Microsoft Access ACCDB File?


Using CX-Supervisor 3.2
Since CX-Supervisor version 3.2, direct connections to both the Microsoft Access MDB and ACCDB file formats are supported, in both the Machine edition and PLUS edition. Simply add a new database connection in the normal way, and browse for your .MDB or .ACCDB file to create the connection.
Using CX-Supervisor 3.0 or 3.1
If you are developing with CX-Supervisor 3.0 or 3.1, then we recommend registering your software so you can access the free updates. Then you can upgrade to the latest version and follow the advice above.
Alternatively you can connect to the ACCDB database using a DSN file, as explained below.
Using older versions
Older versions of CX-Supervisor can only connect to databases that use the new ACCDB file format used in Microsoft Office 2007 and 2010 by creating a 'DSN' file. Note that this will require the PLUS edition in order to connect.
 
You can manually create a text file and save it as .DSN but its much easier (and less prone to errors) if you use the ODBC Data Source Administrator that comes with Windows.  In Windows 7, this can be found under Control Panel under 'System and Security' and 'Administrative Tools' and the 'Data Sources (ODBC)' icon. In Windows XP the icon is under 'Control Panel' and 'Administrative Tools'. If you are running Windows 7 you can simply type ODBC and enter in the search bar in the Start menu:
 

The ODBC Data Source Administrator will pop up and you must press the 'File DSN' tab:

 
 

You must now press the 'Add' button to start creating a new file DSN.

From the first dialog, select the type of database we are connecting to from the list, this is Microsoft Access Driver (*.mdb, *.accdb) then press next.

Next select the location and name of the file dsn you want to create. Its a good idea to put this in the same place as your CX-Supervisor project or in the same place as the database file, you can use the browse button to help.

The creation of the DSN file is now complete. You must now press 'Finish'.

 

Once finish has been pressed, it will pop up with a new dialog to configure the Microsoft Access connection - i.e. find the actual Access database file.

Pressing the select button will pop up a file browser where you must locate and select the ACCDB file you've created in Access.

Once you've located the file press OK and then OK again on the ODBC Access Setup Window. You have now created the DSN file. If you locate the file on disk and open it, it will look something like:

[ODBC]
DRIVER=Microsoft Access Driver (*.mdb, *.accdb)
UID=admin
UserCommitSync=Yes
Threads=3
SafeTransactions=0
PageTimeout=5
MaxScanRows=8
MaxBufferSize=2048
FIL=MS Access
DriverId=25
DefaultDir=D:\Test and Demo Projects\accdbconnection
DBQ=D:\Test and Demo Projects\accdbconnection\Database3.accdb

Now we must select this database connection in CX-Supervisor.

On the Database tab of the Workspace pane, right click and 'Add Connection':

This will pop up the Add Connection Dialog:

Press the ... button to select the datasource.

Note that in order to browse for DSN files you must select the file type on the bottom right of the window:

If mdb is the only one visible in this list, you must convert your project to a PLUS project by selecting Project -> Runtime settings ->Target Settings and choosing PLUS Edition.

Once you have located the DSN file. You are now ready to connect to the ACCDB file as you would with any other database in CX-Supervisor.

 




Comments (View All Comments / Add Comment)
woJDUIqhmjGdky
Got it! Thanks a lot again for helpnig me out!
Lyddy [2011-07-24]

Related Articles
No related articles found.
Created 2011-07-06
Modified 2012-11-28
Views 6599

 

You are not logged in.