>> I found this site while surfing on the net to use ODBC instead of OLEDB and on the link below shows that there are three major reasons that they were not using OLEDB:
>
> http://www.15seconds.com/Issue/961210.htm?voteresult=5
>
> Reason not to use OLEDB:
> OLEDB does not support connection caching.
> OLEDB is slower then ODBC.
> OLEDB requires more code.
>
> but some says OLEDB is much faster than ODBC.... The only "some" people who make unqualified statements that OLEDB is faster than ODBC is Microsoft. The reason? Well, first it is THEIR technology and, if you use it you are tied to using Windows, and Microsoft tools (OLEDB is not supported on non-windows platforms). Second, it IS faster, but only if you are working in VB/.NET and using a back end database. When you use VFP (which is optimized for ODBC) then it is NOT faster. All of my testing has shown that ODBC is up to 30 times faster than OLDEB
in VFP.
I repeat, this is not to say that you will get the same result in other environments/situations, but in VFP there is no doubt that ODBC is significantly faster than OLEDB.
Also, you are assuming that ODBC and OLEDB are, in some sense, equivalent. This is an error, they are NOT, they are entirely different and are intended for entirely different uses.
ODBC defines standard interfaces for accessing data in a variety of relational databases. It is fast, lightweight, and provides a common method that is not optimized for any specific data source.
Is is intended for use with relational databases that support SQL only
- Not reliant on Native API
- Not reliant on Operating System
- In VFP returns a VFP Cursor
OLE DB is a set of Component Object Model (COM) interfaces that provide applications with uniform access to data stored in diverse information sources and that also provide the ability to implement additional database services. These interfaces support the amount of DBMS functionality appropriate to the data store, enabling it to share its data.
It is intended for use with any data store, relational or not, whether or not it supports SQL
- Totally reliant on Native API
- COM based, so totally reliant on Operating System
- Results always returned as an ActiveX Data Object
So if what you want to do is access a relational database from VFP then ODBC is the only rational choice!
Regards
Andy Kramek
Microsoft MVP (Visual FoxPro)
Tightline Computers Inc, Akron Ohio, USA