FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour use Result of SQL Query like "ADODB.Recordset"
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
use Result of SQL Query like "ADODB.Recordset"
Posted: Fri Jun 30, 2023 06:41 AM
hi,

when using "ADODB.Connection" and "ADODB.Recordset" it is easy to "navigate" as "ADODB.Recordset" have Method for it

Question : what to use with ODBC or "native" :?:

"normal" i would say : fill Array with "Result" ... is there a "other" Way :idea:
greeting,

Jimmy
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: use Result of SQL Query like "ADODB.Recordset"
Posted: Fri Jun 30, 2023 12:44 PM

Do you mean you want to connect using ODBC driver natively and not through ADO?

You can do it, though it is a thing of the past.

FWH provides

todbc.prg and todbcrdd.prg and more

You can also test TOdbcDirect class in tdbodbcd.prg

To be honest, I tested TOdbc class of FWH some decades back with Oracle and it worked well.

But soon I started using ADO and no going back.

You can try working with the ODBC classes provided by FWH

Regards



G. N. Rao.

Hyderabad, India
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: use Result of SQL Query like "ADODB.Recordset"
Posted: Fri Jun 30, 2023 01:32 PM

As Rao mentions ODBC is a thing of the past .. specifically, lets say I have a corporate SQL application that needs to run on 3000 machines .. that means that (someone ) has to physically go to each of those machines and make sure ODBC is loaded and configured properly .. ADO has no such limitations because oledb comes with every Microsoft operating system and there is no going to every desktop to configure anything ..

ADO is the way to connect to Oracle, SQL Server and to MS Access and more ..

Rick Lipkin

Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: use Result of SQL Query like "ADODB.Recordset"
Posted: Fri Jun 30, 2023 09:20 PM
hi,

thx for Answer
i would use OLEDB ... if i get a "Driver" for it

but it "seems" it is not "free" for PostgreSQL any more

---

my "DualGRID" is not a "normal" App ... it should be like a "Swiss Knife" where you got a lot of Tools
it is not for User to "work" ... it is for Admin to get "quick Overview" and later "repair"

i want to learn how it work with Fivewin 64 Bit what i have made with Xbase++ and 32 Bit

---

it is a general Question how to handle BIG "Result" of SQL Query where NOT "LIMIT" is used
to "open" BIG Table (> 2.000.000) without "LIMIT" it can take Minutes even in PgAdmin

next is to "browse" and "navigate" ...
when using ADODB i got Method to "navigate" but how with ODBC :?:

for my "native" Solution i use Listview and a "Cursor" which is "LIMITed" to Size of "Browse"
so i use a lot of Ways but always try to find "other" Way which is "faster"
greeting,

Jimmy
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: use Result of SQL Query like "ADODB.Recordset"
Posted: Sat Jul 01, 2023 03:10 AM
i would use OLEDB ... if i get a "Driver" for it
but it "seems" it is not "free" for PostgreSQL any more
Microsoft introduced ADO as an advancement over ODBC.
ADO is designed work both with ODBC drivers and OLEDB providers.
We need not have OLEDB provider to use ADO. We can use ADO with ODBC drivers also in a way better than using ODBC directly.

We need to prepare the connection string suitably.
For OLEDB providers, we start with "Provider=<OLEDB provider>;..."
For ODBC drivers, we start with "Provider=MSDASQL;{Driver=<ODBC driver>};..."

For instance, we always connect to MySql servers with ODBC drivers only with the above syntax:

Still if you want to use ODBC directly and not through ADO, FWH provides enough classes and they did work for me with Oracle longtime ago.

Note: I never tried 64 bit ODBC driver
Regards



G. N. Rao.

Hyderabad, India

Continue the discussion