Page 1 of 1

best code for

Posted: Tue Dec 17, 2019 8:39 pm
by damianodec
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: Select all

...
// 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

Re: best code for

Posted: Tue Dec 17, 2019 10:41 pm
by Enrico Maria Giordano
Yes, INSERT INTO is the best option.

EMG

Re: best code for

Posted: Wed Dec 18, 2019 7:19 am
by damianodec
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

Re: best code for

Posted: Wed Dec 18, 2019 9:13 am
by Enrico Maria Giordano
Probably. But I prefer to not hide something (ADO) that already hides something else.

EMG

Re: best code for

Posted: Wed Dec 18, 2019 7:07 pm
by nageswaragunupudi
oCn:Execute is the best solution or are there other better FW_ function ?
oCn:Execute( cSql ) is the most suitable method to use here.

Re: best code for

Posted: Thu Dec 19, 2019 7:45 am
by damianodec
thank you!