Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

if I'm using VFP with OLEDB is necesary use the functions API's ?

4 posts in OLEDB Last posting was on 2007-09-28 10:10:48.0Z
Hugo Glez Posted on 2007-09-27 15:36:50.0Z
From: "Hugo Glez" <gomh7172@prodigy.net.mx>
Newsgroups: Advantage.OLEDB
Subject: if I'm using VFP with OLEDB is necesary use the functions API's ?
Date: Thu, 27 Sep 2007 10:36:50 -0500
Lines: 55
Organization: 3GM
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: 189.165.50.70
Message-ID: <46fbccd2@solutions.advantagedatabase.com>
X-Trace: 27 Sep 2007 09:31:30 -0700, 189.165.50.70
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!189.165.50.70
Xref: solutions.advantagedatabase.com Advantage.OLEDB:1251
Article PK: 1133771

Hi,

Just a question,

if I'm using VFP with OLEDB is necesary use the functions API's ?

I'm using VFP with OLEDB the next form:

lcCnx=CREATEOBJECT("ADODB.Connection")
lcCnx.connectionString = connectionString
lcCnx.OPEN()

prmRS=CREATEOBJECT("ADODB.RecordSet")
prmRS.LockType = 3 && Optimistic
prmRS.CursorLocation= 3 && adUseClient
prmRS.CursorType= 1 && adOpenKeyset *adOpenDynamic

Examples:
m.comando = "insert into paciente (p_id, p_name) values( '" + m.p_id +
"', '" + m.p_name + "' )"

if prmRS.state = 1
prmRS.close
endif
prmRS.OPEN(m.comando,lcCnx)


m.comando = "update paciente set p_status = " + STR(m.mu_minimo, 2) + " "
+ ;
"where p_id = '" + m.p_id + "' "

prmRS.OPEN(m.comando,lcCnx)


TEXT to lcComando noshow textmerge pretext 7
SELECT p_name, p_adress, p_phone, p_status
FROM paciente
ENDTEXT

lres = prmRS.OPEN(pcomando,lcCnx)

My Question. Is nesesary to use the next function's API's too?

guretval = AdsConnect(grutaadv, @ghconnapic)
luretval = AdsOpenTable(ghconnapic,gcfileadvctrl, "NULL", ;
ulRetVal = AdsLockRecord(gnhtablectrl,1)
ulRetVal = AdsSetField(gnhtablectrl, 'prog_cita',
strzero(lnprog_citanvo,6), 6)
ulRetVal = AdsWriteRecord(gnhtablectrl) && ESCRIBE LOS CAMBIOS!
ulRetVal = AdsUnLockRecord(gnhtablectrl,1) && DESBLOQUEA LA TABLA!

Thank's
Hugo Glez.


Lance Schmidt Posted on 2007-09-27 19:46:07.0Z
From: "Lance Schmidt" <LanceSc@ExtendSys.com>
Newsgroups: Advantage.OLEDB
References: <46fbccd2@solutions.advantagedatabase.com>
Subject: Re: if I'm using VFP with OLEDB is necesary use the functions API's ?
Date: Thu, 27 Sep 2007 13:46:07 -0600
Lines: 71
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 10.24.38.197
Message-ID: <46fc074b@solutions.advantagedatabase.com>
X-Trace: 27 Sep 2007 13:40:59 -0700, 10.24.38.197
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!10.24.38.197
Xref: solutions.advantagedatabase.com Advantage.OLEDB:1253
Article PK: 1133773

Hi Hugo,

There is no reason to use the API unless you want to access the table
navigationally. What problems are you seeing?

Best Regards,

Lance Schmidt
Advantage R&D

"Hugo Glez" <gomh7172@prodigy.net.mx> wrote in message
news:46fbccd2@solutions.advantagedatabase.com...
> Hi,
>
> Just a question,
>
> if I'm using VFP with OLEDB is necesary use the functions API's ?
>
> I'm using VFP with OLEDB the next form:
>
> lcCnx=CREATEOBJECT("ADODB.Connection")
> lcCnx.connectionString = connectionString
> lcCnx.OPEN()
>
> prmRS=CREATEOBJECT("ADODB.RecordSet")
> prmRS.LockType = 3 && Optimistic
> prmRS.CursorLocation= 3 && adUseClient
> prmRS.CursorType= 1 && adOpenKeyset *adOpenDynamic
>
> Examples:
> m.comando = "insert into paciente (p_id, p_name) values( '" + m.p_id +
> "', '" + m.p_name + "' )"
>
> if prmRS.state = 1
> prmRS.close
> endif
> prmRS.OPEN(m.comando,lcCnx)
>
>
> m.comando = "update paciente set p_status = " + STR(m.mu_minimo, 2) + " "
> + ;
> "where p_id = '" + m.p_id + "' "
>
> prmRS.OPEN(m.comando,lcCnx)
>
>
> TEXT to lcComando noshow textmerge pretext 7
> SELECT p_name, p_adress, p_phone, p_status
> FROM paciente
> ENDTEXT
>
> lres = prmRS.OPEN(pcomando,lcCnx)
>
> My Question. Is nesesary to use the next function's API's too?
>
> guretval = AdsConnect(grutaadv, @ghconnapic)
> luretval = AdsOpenTable(ghconnapic,gcfileadvctrl, "NULL", ;
> ulRetVal = AdsLockRecord(gnhtablectrl,1)
> ulRetVal = AdsSetField(gnhtablectrl, 'prog_cita',
> strzero(lnprog_citanvo,6), 6)
> ulRetVal = AdsWriteRecord(gnhtablectrl) && ESCRIBE LOS CAMBIOS!
> ulRetVal = AdsUnLockRecord(gnhtablectrl,1) && DESBLOQUEA LA TABLA!
>
> Thank's
> Hugo Glez.
>
>


Hugo Glez Posted on 2007-09-28 05:38:23.0Z
From: "Hugo Glez" <gomh7172@prodigy.net.mx>
Newsgroups: Advantage.OLEDB
References: <46fbccd2@solutions.advantagedatabase.com> <46fc074b@solutions.advantagedatabase.com>
Subject: Re: if I'm using VFP with OLEDB is necesary use the functions API's ?
Date: Fri, 28 Sep 2007 00:38:23 -0500
Lines: 91
Organization: 3GM
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 189.165.50.70
Message-ID: <46fc9210@solutions.advantagedatabase.com>
X-Trace: 27 Sep 2007 23:33:04 -0700, 189.165.50.70
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!189.165.50.70
Xref: solutions.advantagedatabase.com Advantage.OLEDB:1254
Article PK: 1133774

Hi Lance ,

I have a "ctrl" table, where I'm define the Consecutive a invoice, then I
need to lock the ctrl record,
when the user want to print a invoice , and increases the Consecutive, and
after that unlock the record.

About this way, I'm going to avoid duplicate INVOICE NUMBER. Then I want to
know, How can I lock and
unlock a record (I'm using OLEDB)?

Thank's ,
Hugo
Cibernetica de M?xico

"Lance Schmidt" <LanceSc@ExtendSys.com> escribi? en el mensaje
news:46fc074b@solutions.advantagedatabase.com...

> Hi Hugo,
>
> There is no reason to use the API unless you want to access the table
> navigationally. What problems are you seeing?
>
> Best Regards,
>
> Lance Schmidt
> Advantage R&D
>
>
>
> "Hugo Glez" <gomh7172@prodigy.net.mx> wrote in message
> news:46fbccd2@solutions.advantagedatabase.com...
>> Hi,
>>
>> Just a question,
>>
>> if I'm using VFP with OLEDB is necesary use the functions API's ?
>>
>> I'm using VFP with OLEDB the next form:
>>
>> lcCnx=CREATEOBJECT("ADODB.Connection")
>> lcCnx.connectionString = connectionString
>> lcCnx.OPEN()
>>
>> prmRS=CREATEOBJECT("ADODB.RecordSet")
>> prmRS.LockType = 3 && Optimistic
>> prmRS.CursorLocation= 3 && adUseClient
>> prmRS.CursorType= 1 && adOpenKeyset *adOpenDynamic
>>
>> Examples:
>> m.comando = "insert into paciente (p_id, p_name) values( '" + m.p_id +
>> "', '" + m.p_name + "' )"
>>
>> if prmRS.state = 1
>> prmRS.close
>> endif
>> prmRS.OPEN(m.comando,lcCnx)
>>
>>
>> m.comando = "update paciente set p_status = " + STR(m.mu_minimo, 2) + "
>> " + ;
>> "where p_id = '" + m.p_id + "' "
>>
>> prmRS.OPEN(m.comando,lcCnx)
>>
>>
>> TEXT to lcComando noshow textmerge pretext 7
>> SELECT p_name, p_adress, p_phone, p_status
>> FROM paciente
>> ENDTEXT
>>
>> lres = prmRS.OPEN(pcomando,lcCnx)
>>
>> My Question. Is nesesary to use the next function's API's too?
>>
>> guretval = AdsConnect(grutaadv, @ghconnapic)
>> luretval = AdsOpenTable(ghconnapic,gcfileadvctrl, "NULL", ;
>> ulRetVal = AdsLockRecord(gnhtablectrl,1)
>> ulRetVal = AdsSetField(gnhtablectrl, 'prog_cita',
>> strzero(lnprog_citanvo,6), 6)
>> ulRetVal = AdsWriteRecord(gnhtablectrl) && ESCRIBE LOS CAMBIOS!
>> ulRetVal = AdsUnLockRecord(gnhtablectrl,1) && DESBLOQUEA LA TABLA!
>>
>> Thank's
>> Hugo Glez.
>>
>>
>
>
>


Joachim Duerr (ADS) Posted on 2007-09-28 10:10:48.0Z
From: "Joachim Duerr (ADS)" <jojo.duerr@gmx.de>
Subject: Re: if I'm using VFP with OLEDB is necesary use the functions API's ?
Newsgroups: Advantage.OLEDB
References: <46fbccd2@solutions.advantagedatabase.com> <46fc074b@solutions.advantagedatabase.com> <46fc9210@solutions.advantagedatabase.com>
Organization: iAnywhere
User-Agent: XanaNews/1.18.1.2
X-Face: ,QMv7[luB)BpWAQ~:"kw6n%0ieY63.:g2K3n~8ky0;||5Xle*Xq+=~<Fy:0CVC2nx@8~vZ
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
NNTP-Posting-Host: 10.56.66.155
Message-ID: <46fcc518@solutions.advantagedatabase.com>
Date: 28 Sep 2007 03:10:48 -0700
X-Trace: 28 Sep 2007 03:10:48 -0700, 10.56.66.155
Lines: 20
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!10.56.66.155
Xref: solutions.advantagedatabase.com Advantage.OLEDB:1255
Article PK: 1133775


Hugo Glez wrote in <46fc9210@solutions.advantagedatabase.com>:

> I have a "ctrl" table, where I'm define the Consecutive a invoice,
> then I need to lock the ctrl record, when the user want to print a
> invoice , and increases the Consecutive, and after that unlock the
> record.
>
> About this way, I'm going to avoid duplicate INVOICE NUMBER. Then I
> want to know, How can I lock and unlock a record (I'm using OLEDB)?

the easiest way: use a transaction, update the record (it gets locked),
update other records in other tables (they will also get locked)...if
all succeeds, commit otherwise rollback (after committing or rolling
back the transaction, the records will get unlocked).

--
Joachim Duerr
System Consultant (Advantage Database Server)
Sybase iAnywhere
advantagesupport[AT]ianywhere.com