Re: Diff type of data fetching



Hi Den
ODBC and OLE DB are two different sets of commands and functions as drivers
for connections to client/server SQL databases. In VFP these are called
'remote databases'.
ODBC is an industry standard supported by Microsoft; OLE DB is a Microsoft
Windows specific rival technology.
MS thought their OLEDB classes would make ODBC obsolete but they have had
second thoughts and will continue to fully support their own RDBMS product
"SQL Server" with an powerful and fully featured ODBC driver. Windows also
comes with an ODBC driver for MSAccess and Oracle databases. They are
distributed and updated with the MDAC package.
The ODBC driver for FoxPro databases was dropped in VFP7 and replaced with
an OLEDB provider.

OLEDB is a set of COM classes, ODBC uses C functions.
That's why OLEDB is initialized with CREATEOBJECT() calls such as
o1 = CreateObject('ADODB.Connection')
o2 = CreateObject('ADODB.Command')
o3 = CreateObject('ADODB.RecordSet')
o4 = CreateObject('ADOX.Catalog')

Visual FoxPro has functionality for using ODBC built into 14 functions that
all begin with the letters SQL..., like SQLSTRINGCONNECT(), SQLEXE(),
SQLPREPARE() and so on.
The 'remote view' functionality built into VFP databases, the Database
Designer, the View Designer and CREATE CONNECTION and the Connection
Designer are all wrappers for this technology.

The connections strings used for ODBC and OLEDB are purposely quite
different using different keywords for what is essentially the 'same thing'.

OLEDB permits calling ODBC drivers but this is now a deprecated usage as
far as Microsofts own ODBC drivers is concerned. Initializing OLEDB with
VFP's SQLCONNECT() is just not possible at all.

VFP's CursorAdapter class is intended to support OLEDB.
Still I would say ODBC is by far the less complex and fastest route for VFP
programmers to handle remote databases.
Calls like SQLEXEC(connection, "SELECT query"), SQLTABLES() and SQLCOLUMNS()
,and USE remote_view, all return their results directly in the form of a
VFP cursor.
OLEDB returns an ADO RecordSet object that you have to turn into a cursor
with CursorAdapter.CursorFill method.

The special driver for ODBC to SQL Server 2005, including the Express
editiion, is called 'SQL Native Client'. The SQL Server Compact Edition
(CE/Mobile/Everywhere, the name varies) only comes with OLEDB drivers.
SQL Native Client supports everything in SQL Server except XML I believe.

-Anders







"Den" <test@xxxxxxxxxx> wrote in message
news:ugAHuDAfHHA.596@xxxxxxxxxxxxxxxxxxxxxxx
sorry for not stating my question more specific.

i'm trying to know the key benefit of these 2 method..
Q1- in what situation are best using SQLStringConnect and when is best to
use ADO?
Q2- In term of data fetching & updating, which method can perform better.?
Q3- when you say SQLStringConnect can only specify ODBC driver,
but what is the benefit of accessing OLEDB directly over ODBC ?

Thanks for your info and patient.



"Anders Altberg" <anders.altberg> wrote in message
news:egRiYw0eHHA.3960@xxxxxxxxxxxxxxxxxxxxxxx
And I was trying to answer that question! I'll have to do better it
seems.
-Anders

"Den" <test@xxxxxxxxxx> wrote in message
news:eK7iA3xeHHA.2376@xxxxxxxxxxxxxxxxxxxxxxx
sorry, i was try to ask whats the different between fetching data using
SQLStringConnect and ADO.


"Anders Altberg" <anders.altberg> wrote in message
news:e$6m9doeHHA.4916@xxxxxxxxxxxxxxxxxxxxxxx
VFP's SQLStringConnect function can only specify a ODBC driver in the
DRIVER parameter.
If you want to use ADODB you use the ConnectionString property of the
Connection class.
This string can refer to OLEDB drivers or ODBC drivers. You then
create a RecordSet object, sometimes by way of a Command object. VFP
has the CursorAdapter class for turning a RecordSet into a cursor
before you can work normally with a query result in VFP.
That's more work than getting a cursor in step 1 as we do with queries
through ODBC.
-Anders

"Den" <test@xxxxxxxxxx> wrote in message
news:Op4swhneHHA.3960@xxxxxxxxxxxxxxxxxxxxxxx
what's the different of fetching data using SQLStringConnect() with
ADO ?
what the pros and cons ? and speed different.?

Thanks!>










.



Relevant Pages

  • Re: Diff type of data fetching
    ... drivers for connections to client/server SQL databases. ... ODBC is an industry standard supported by Microsoft; ... MS thought their OLEDB classes would make ODBC obsolete but they have had ... OLEDB permits calling ODBC drivers but this is now a deprecated usage as ...
    (microsoft.public.fox.programmer.exchange)
  • Re: ODBC connection to mdb for MacIntosh
    ... > Microsoft Access does not exist for the Mac. ... As long as the computer has ODBC drivers for an Access ... You can use the MS Query interface to create any SQL command ...
    (microsoft.public.mac.otherproducts)
  • Re: End-user software to query a warehouse?
    ... > worked, using ODBC, but now I'm battling a slightly different battle, with ... It really sucks that "ordinary" ODBC client ... applications can query the DB2 no problems, but when SQL Server ... with the API functions it uses to talk to IBM's drivers. ...
    (microsoft.public.sqlserver.datawarehouse)
  • Re: ODBC on UNIX/Linux? Want to support UNIX ODBC in my xtopdf project
    ... I'll check out the Drivers section. ... Does anyone have experience using ODBC on UNIX? ... through unixODBC for accessing mainframe data. ...
    (comp.unix.programmer)
  • Re: Remove DB connections
    ... What drivers are you using? ... Proprietary, OLEDB or ODBC? ... Are you use the same connection string each time? ...
    (microsoft.public.inetserver.asp.db)