LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Accessing Citadel Data Using MS ADO

Anyone successfully connected to a citadel database using
activeX-data-objects (ADO) and VBA?
I try to retrieve data from a citadel database. Though I can do this with
ms-query I would like the user to be able to select which channels and the
start and end time from a simple dialog instead of having him go through
editing ms-query settings.

thanks for any help

stefan
0 Kudos
Message 1 of 2
(2,677 Views)
Hi Stefan,
Databases like Oracle, MS Access, SQL Server... are business database and are sold for general purpose, thus has to provide full-ODBC support. Since ADO can call ODBC drivers also ADO is going to work (moreover all major database vendors has converted their driver to plain ADO to bypass ODBC and reduce the overhead).
Citadel is not a relational database, but historical database that serves to a specific purpose. The OBDC driver only supports some specific subset needed to get it to work in the most common environments (like MS Query/Excel, Access etc.). There are parts that are not supported. Browsing table items is one of the supported features (works in MS Query). You use SQLColumns() function to get the list of columns from an ODBC client.
So, where
is the problem. When ADO talks to an ODBC driver it works as a wrapper for the ODBC and basically translates all ADO calls to the ODBC calls. Unfortunately the translation often result in ODBC calls that are not supported by Citadel ODBC driver. While this driver was developed to have all neccessary functionality for common ODBC clients it does not have full functionality to support ADO interface (ADO came out later than the driver). It does not mean you cannot use ADO at all. You can, but some calls are going to return an error. I was able to run a different ADO client fine, the only place it failed was getting the list of columns, because the client was trying to execute following statement to get the list: "select * from traces where 0=1" (this is an SQL compliant statement, but is not supported by Citadel. Again the support is limited to statements needed to get data back). For examples of supported statements check the National Resource Library on Developer Zone.
For any trouble
shooting I recommned tracing ODBC calls. ODBC Administrator >> Trace. Check which call fails and try to workaroung it with a working one. To get a working sequence trace MS Query calls for example.
I hope this helps.

Martin
Message 2 of 2
(2,677 Views)