FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour best code for
Posts: 434
Joined: Wed Jun 06, 2007 02:58 PM
best code for
Posted: Tue Dec 17, 2019 08:39 PM
hi,
I need a suggestion, what's the best solution for interactive ADODB I/O app ?
I'd like a app that by dialog manages data of SQL server:
Code (fw): Select all Collapse
...
// connection
oCn := FW_OpenAdoConnection( ConnectString, .t.)

...
// HERE DIALOG...

cExecute := "INSERT INTO TABLE (CODE, DESC) VALUES (cCode, cDescr)"
    try
        oCn:Execute( cExecute)
        msginfo("insert ok")
    Catch
        msginfo("insert error")
    End Try 
...


is this (oCn:Execute) a good way ?
are there others ways for manage I/O data by ADO connection?

thanks
FiveWin for xHarbour 24.02 - Feb. 2024 - Embarcadero C++ 7.60 for Win32 Copyright (c) 1993-2023

FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)

Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: best code for
Posted: Tue Dec 17, 2019 10:41 PM

Yes, INSERT INTO is the best option.

EMG

Posts: 434
Joined: Wed Jun 06, 2007 02:58 PM
Re: best code for
Posted: Wed Dec 18, 2019 07:19 AM

hi Enrico, thank you,
what I'd like to know is if oCn:Execute is the best solution or are there other better FW_ function ?

thank you

FiveWin for xHarbour 24.02 - Feb. 2024 - Embarcadero C++ 7.60 for Win32 Copyright (c) 1993-2023

FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)

Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: best code for
Posted: Wed Dec 18, 2019 09:13 AM

Probably. But I prefer to not hide something (ADO) that already hides something else.

EMG

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: best code for
Posted: Wed Dec 18, 2019 07:07 PM
oCn:Execute is the best solution or are there other better FW_ function ?

oCn:Execute( cSql ) is the most suitable method to use here.
Regards



G. N. Rao.

Hyderabad, India
Posts: 434
Joined: Wed Jun 06, 2007 02:58 PM
Re: best code for
Posted: Thu Dec 19, 2019 07:45 AM

thank you!

FiveWin for xHarbour 24.02 - Feb. 2024 - Embarcadero C++ 7.60 for Win32 Copyright (c) 1993-2023

FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)

Visual Studio 2019 - Pelles C V.8.00.60 (Win64)

Continue the discussion