LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using database without ODBC

It's possible to use a database without ODBC in Labview??
0 Kudos
Message 1 of 18
(5,884 Views)


@IDILIO wrote:
It's possible to use a database without ODBC in Labview??



Of course! You can use ADO instead, which is what is used in the Database connectivity Toolkit.

And on a somewhat less serious note: If you really want to go the really, really hard way, you could try to reverse engineer the database file format and access it with binary file reads!!!!

Rolf Kalbermatter

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 2 of 18
(5,873 Views)
"You can use ADO instead, which is what is used in the Database connectivity Toolkit"
 
In the Database connectivity Toolkit at the "DB Tools Open Connection" VI in the input  "connection information" i need to address a dsn file or a system data source, so i need to have an ODBC driver isn't that right??
 
 
Access with binary file reads the database file format in an Oracle database located on a remote server i don't think so, maybe isn't possible at all.
0 Kudos
Message 3 of 18
(5,870 Views)


@IDILIO wrote:
"You can use ADO instead, which is what is used in the Database connectivity Toolkit"
 
In the Database connectivity Toolkit at the "DB Tools Open Connection" VI in the input  "connection information" i need to address a dsn file or a system data source, so i need to have an ODBC driver isn't that right??
 
 
Access with binary file reads the database file format in an Oracle database located on a remote server i don't think so, maybe isn't possible at all.


Data Source Names and System Data Sources were introduced with ODBC drivers but are not limited to them. ADO also can use directly ADO drivers to communicate with databases. From a users point of view it does not really matter if the connection ist done through ADO directly or through the ADO built in ODBC bridge through an ODBC driver.

Just look on the Oracle side for OLE DB (hmm I for one can't find them) or ODBC drivers that are compatible for your version of of the database engine and install them in your Windows system.

That will work. Alternatively you can also try to use the Microsoft ODBC for Oracle driver that comes with the Database Desktop Driver Installer form Microsoft. But I'm not sure which versions of the Oracle database engines this driver supports.

As I already mentioned the note about accessing the database directly through binary reads was not meant seriously. But your original post was a bit in the style of "Can I go from Washington to New York without a car?" and I felt like answering yes take the plane.

Rolf Kalbermatter

Message Edited by rolfk on 01-26-2007 03:20 PM

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
Message 4 of 18
(5,868 Views)

Hi Rolf,

At this moment I m using the Microsoft ODBC driver for Oracle and it works ok, but my problem is when i do several reads at the database it reflects in a big delay for the Front Panel.

As i know that the ODBC driver is a very slow method to access database i m searching for a faster way to do it. Do you have any suggestions?

 

0 Kudos
Message 5 of 18
(5,854 Views)
Using ADO, you can just specify a database file as the data source. I use LabSQL and my connection string specifies MS Jet OLEDB 4.0 and the .mdb file as the data source. This way I can use it on many computers without setting up the dsn and whatever else I would need. I have no experience with the database connectivity toolkit though, so it might be different.
0 Kudos
Message 6 of 18
(5,847 Views)


@IDILIO wrote:

Hi Rolf,

At this moment I m using the Microsoft ODBC driver for Oracle and it works ok, but my problem is when i do several reads at the database it reflects in a big delay for the Front Panel.

As i know that the ODBC driver is a very slow method to access database i m searching for a faster way to do it. Do you have any suggestions?


It's not ODBC that is necessarily slow. It is usually the way you retrieve data that has a lot more influence on the speed of the data retrieval. In the case of the Microsoft ODBC driver it might be that this driver is not specifically optimized for speed for various reasons.

First implementing someone elses protocol is always difficult (not sure how well Oracle documents their protocol) and the temptation to stop when it is working rather than when it is working perfect is much bigger. Also it is of course not in Microsofts interest to provide you with a solution for Oracle that outperforms their own SQL Server interface so that is even one more incentive to stop when it is working rather than when it is working perfect.

Have you tried to use the Oracle ODBC drivers? They might be more optimized so that retrieving data through ADO can be faster.

Very important is how you retrieve the data however. The classical and simple way of retrieving data element for element is very slow. For this ADO/OLE DB has introduced rowsets which query several rows of a query result at once in one single driver request and then later allow the client to retrieve the elements locally into the native data. This is for remote databases always a huge performance improvement, since the bottle neck here is the network communication and not the memory manager or IO interface.So requesting one whole bunch of rows at once instead of element by element reduces the network traffic substantially and increases the performance at the cost of some extra memory usage for local caching. And the best thing is that the ADO rowsets can be mapped to ODBC cursor sets if the ODBC driver supports cursor sets and the ADO ODBC bridge does that transparently for you. Accessing ODBC directly you could also use cursor sets, but the API for doing that is really not for the faint hearted. ADO rowsets in comparison are very simple to use.

Try to read a bit about ADO database query optimizations on the web to get an idea of the techniques used and they usually can be quite simply translated to ADO methods as used in the Database Connectivity Toolkit or any of the other ADO based toolkits out there.

Rolf Kalbermatter

Message Edited by rolfk on 01-26-2007 04:14 PM

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 7 of 18
(5,836 Views)
One way to speed up a querie is to use a stored procedure (or whatever the equivalent name is in Oracle). Also, without knowing the exact query you are running, how you are running it, the design of the database itself, the size of the database, the amount of data you are getting, it's a little hard to offer specific help.
0 Kudos
Message 8 of 18
(5,833 Views)


@marc A wrote:
Using ADO, you can just specify a database file as the data source. I use LabSQL and my connection string specifies MS Jet OLEDB 4.0 and the .mdb file as the data source. This way I can use it on many computers without setting up the dsn and whatever else I would need. I have no experience with the database connectivity toolkit though, so it might be different.

This won't work for Oracle. First they are typically on a server that is not necessarily accessible through file sharing at all (and the administrator that makes the database directories accessible from the network should be sent to the moon without any pressure suit) and second is Oracle not so stupid to try to stuff all information into a single file.

Rolf Kalbermatter

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 9 of 18
(5,829 Views)

In this case It's not the way i retrieve data that has a lot more influence on the speed of the data retrieval, because in the reality i m not doing queries, but yes calling stored procedures/functions in the oracle database like Dennis suggests. So the problem isn't on the algorithm, but yes on the connection mode. All the code is totally optimized and there is no way to do fewer calls to the procedures, the time consumed is on the ODBC access time. I also try to use the Oracle ODBC drivers, but is exactly the same that the Microsoft driver.

By example i have a vi in LabView using the ODBC that takes around 4 minutes to do all the work, and the same algorithm in Java using JDBC takes just around 40 seconds.

And the ODBC that is necessarily slow comparing to a direct database access. Calling the same procedure, in LabView using ODBC takes around 150ms and directly on SQLplus just 20ms.

I m not familiarly with ADO, and i really don't know how to use them, but do you think that can help in this connection speed issue?
Others suggestions appreciated.

 

 

 

0 Kudos
Message 10 of 18
(5,821 Views)