what's the different of fetching data using SQLStringConnect() with ADO ?
what the pros and cons ? and speed different.?

Thanks!

Re: Diff type of data fetching by Anders

Anders
Mon Apr 09 04:14:34 CDT 2007

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@gromro.com> wrote in message
news:Op4swhneHHA.3960@TK2MSFTNGP02.phx.gbl...
> what's the different of fetching data using SQLStringConnect() with ADO ?
> what the pros and cons ? and speed different.?
>
> Thanks!>



Re: Diff type of data fetching by Den

Den
Mon Apr 09 22:10:05 CDT 2007

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@TK2MSFTNGP06.phx.gbl...
> 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@gromro.com> wrote in message
> news:Op4swhneHHA.3960@TK2MSFTNGP02.phx.gbl...
>> what's the different of fetching data using SQLStringConnect() with ADO ?
>> what the pros and cons ? and speed different.?
>>
>> Thanks!>
>
>



Re: Diff type of data fetching by Anders

Anders
Tue Apr 10 03:41:49 CDT 2007

And I was trying to answer that question! I'll have to do better it seems.
-Anders

"Den" <test@gromro.com> wrote in message
news:eK7iA3xeHHA.2376@TK2MSFTNGP04.phx.gbl...
> 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@TK2MSFTNGP06.phx.gbl...
>> 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@gromro.com> wrote in message
>> news:Op4swhneHHA.3960@TK2MSFTNGP02.phx.gbl...
>>> what's the different of fetching data using SQLStringConnect() with ADO
>>> ?
>>> what the pros and cons ? and speed different.?
>>>
>>> Thanks!>
>>
>>
>
>



Re: Diff type of data fetching by Den

Den
Wed Apr 11 01:16:13 CDT 2007

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@TK2MSFTNGP02.phx.gbl...
> And I was trying to answer that question! I'll have to do better it seems.
> -Anders
>
> "Den" <test@gromro.com> wrote in message
> news:eK7iA3xeHHA.2376@TK2MSFTNGP04.phx.gbl...
>> 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@TK2MSFTNGP06.phx.gbl...
>>> 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@gromro.com> wrote in message
>>> news:Op4swhneHHA.3960@TK2MSFTNGP02.phx.gbl...
>>>> what's the different of fetching data using SQLStringConnect() with ADO
>>>> ?
>>>> what the pros and cons ? and speed different.?
>>>>
>>>> Thanks!>
>>>
>>>
>>
>>
>
>



Re: Diff type of data fetching by Anders

Anders
Wed Apr 11 06:33:16 CDT 2007

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@gromro.com> wrote in message
news:ugAHuDAfHHA.596@TK2MSFTNGP06.phx.gbl...
> 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@TK2MSFTNGP02.phx.gbl...
>> And I was trying to answer that question! I'll have to do better it
>> seems.
>> -Anders
>>
>> "Den" <test@gromro.com> wrote in message
>> news:eK7iA3xeHHA.2376@TK2MSFTNGP04.phx.gbl...
>>> 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@TK2MSFTNGP06.phx.gbl...
>>>> 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@gromro.com> wrote in message
>>>> news:Op4swhneHHA.3960@TK2MSFTNGP02.phx.gbl...
>>>>> what's the different of fetching data using SQLStringConnect() with
>>>>> ADO ?
>>>>> what the pros and cons ? and speed different.?
>>>>>
>>>>> Thanks!>
>>>>
>>>>
>>>
>>>
>>
>>
>
>



Re: Diff type of data fetching by Den

Den
Fri Apr 13 01:40:01 CDT 2007

Thanks Anders!!

"Anders Altberg" <anders.altberg> wrote in message
news:eAoQz0CfHHA.4128@TK2MSFTNGP05.phx.gbl...
> 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@gromro.com> wrote in message
> news:ugAHuDAfHHA.596@TK2MSFTNGP06.phx.gbl...
>> 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@TK2MSFTNGP02.phx.gbl...
>>> And I was trying to answer that question! I'll have to do better it
>>> seems.
>>> -Anders
>>>
>>> "Den" <test@gromro.com> wrote in message
>>> news:eK7iA3xeHHA.2376@TK2MSFTNGP04.phx.gbl...
>>>> 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@TK2MSFTNGP06.phx.gbl...
>>>>> 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@gromro.com> wrote in message
>>>>> news:Op4swhneHHA.3960@TK2MSFTNGP02.phx.gbl...
>>>>>> what's the different of fetching data using SQLStringConnect() with
>>>>>> ADO ?
>>>>>> what the pros and cons ? and speed different.?
>>>>>>
>>>>>> Thanks!>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>