X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.193]) by svr1.postgresql.org (Postfix) with ESMTP id 09B9E30DD95 for ; Thu, 12 Jun 2003 18:36:29 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr1.postgresql.org [64.117.224.193]) (amavisd-new, port 10024) with ESMTP id 17538-02 for ; Thu, 12 Jun 2003 15:36:18 -0300 (ADT) Received: from BAY0-HMR12.adinternal.hotmail.com (bay0-hmr12.bay0.hotmail.com [65.54.241.211]) by svr1.postgresql.org (Postfix) with ESMTP id BCF2430DCD9 for ; Thu, 12 Jun 2003 15:36:17 -0300 (ADT) Received: from hotmail.com ([65.54.244.122]) by BAY0-HMR12.adinternal.hotmail.com with Microsoft SMTPSVC(5.0.2195.5600); Thu, 12 Jun 2003 11:36:17 -0700 Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Thu, 12 Jun 2003 11:36:17 -0700 Received: from 168.243.250.27 by bay1-dav18.bay1.hotmail.com with DAV; Thu, 12 Jun 2003 18:36:16 +0000 X-Originating-IP: [168.243.250.27] X-Originating-Email: [magotemp@hotmail.com] MIME-Version: 1.0 Message-Id: <3EE8C7B8.00000C.01780@GUAJ215DESA> Date: Thu, 12 Jun 2003 12:34:32 -0600 Content-Type: Multipart/related; type="multipart/alternative"; boundary="------------Boundary-00=_KXSD7TH0000000000000" X-Mailer: IncrediMail 2001 (1850912) From: "MRGonzalez" References: <20030612160146.43015.qmail@web13806.mail.yahoo.com> X-FID: FLAVOR00-NONE-0000-0000-000000000000 X-FVER: X-CNT: ; X-Priority: 3 To: , Subject: Re: VB Resync Reply-To: "MRGonzalez" X-OriginalArrivalTime: 12 Jun 2003 18:36:17.0066 (UTC) FILETIME=[8287F8A0:01C33111] X-Archive-Number: 200306/24 X-Sequence-Number: 2998 --------------Boundary-00=_KXSD7TH0000000000000 Content-Type: Multipart/Alternative; boundary="------------Boundary-00=_LXSD24L0000000000000" --------------Boundary-00=_LXSD24L0000000000000 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Thank you, it works.=0D =0D Now, I have a single ADO control bound to my table "clients".=0D To add a new record I do this:=0D =0D adoClients.Recordset.AddNew=0D ... block of sentences ...=0D adoClients.Recordset.Update=0D =0D And that works very fine. However when I make some changes=0D and try to update, it raises an error=0D =0D adoClients.Recordset.Update=0D =0D "Row cannot be located for updating. Some values may have been changed since it was last read"=0D =0D Any Ideas,=0D Best regards,=0D =0D =0D MAGO=0D =0D =0D -------Mensaje original-------=0D =0D De: cgg007@yahoo.com=0D Fecha: Jueves, 12 de Junio de 2003 10:01:52 a.=0D A: MRGonzalez; pgsql-odbc@postgresql.org=0D Asunto: Re: [ODBC] VB Resync=0D =0D If you're application is designed to run only with PostgreSQL, let PostgreSQL=0D keep track of the current value of the serial:=0D =0D dataenvironment.connection.execute "Insert Into Detail (FK, Field1, Field2,= =0D FieldN) select currval('whatever_the_PK\'s_sequence_name'),'" & intData1 &= =0D "','" & intData2 & "','" & intDataN & "');"=0D =0D HTH=0D =0D --- MRGonzalez wrote:=0D > I have an application where I save the information of a bill and its detail.=0D > The PK of the header its a serial.=0D > =0D > I need to save the header and get the number of the serial to save it as = a=0D > FK in the detail.=0D > =0D > This is the way I wrote but it raise an error:=0D > =0D > header.recordset.update=0D > header.recordset.resync adAffectCurrent, adResyncAllValues=0D > =0D > dataenvironment.connection.execute "Insert Into Detail (FK, Field1, Field2 =0D > FieldN) Values (" & header.recordset!PK & "," & intData1 & "," & intData2 & =0D > ," & intDataN & ")"=0D > =0D > Any suggestions?=0D > =0D > Thank you in advanced,=0D > =0D > =0D > MAGO=0D =0D =0D __________________________________=0D Do you Yahoo!?=0D Yahoo! Calendar - Free online calendar with sync to Outlook(TM).=0D http://calendar.yahoo.com=20 --------------Boundary-00=_LXSD24L0000000000000 Content-Type: Text/HTML; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Thank you, it works.
 
Now, I have a single ADO control bound to my table "cli= ents".
To add a new record I do this:
 
adoClients.Recordset.AddNew
... block of sentences ...
adoClients.Recordset.Update
 
And that works very fine. However when I make some changes
and try to update, it raises an error
 
adoClients.Recordset.Update
 
"Row cannot be located for updating. Some values may have been changed= since it was last read"
 
Any Ideas,
Best regards,
 
 
MAGO
 
 
-------Mensaje original-------
 
Fecha: Jueves, 12 de= Junio de 2003 10:01:52 a.
Asunto: Re: [ODBC] V= B Resync
 
If you're application is designed to run only with Postgre= SQL, let PostgreSQL
keep track of the current value of the serial:
dataenvironment.connection.execute "Insert Into Detail (FK, Field1, Field= 2,
FieldN) select currval('whatever_the_PK\'s_sequence_name'),'" & i= ntData1 &
"','" & intData2 & "','" & intDataN & "');= "

HTH

--- MRGonzalez <magotemp@hotmail.com> wrote:
> I have an application where= I save the information of a bill and its detail.
> The PK of the hea= der its a serial.
>
> I need to save the header and get the nu= mber of the serial to save it as a
> FK in the detail.
>
&g= t; This is the way I wrote but it raise an error:
>
> header.r= ecordset.update
> header.recordset.resync adAffectCurrent, adResyncAl= lValues
>
> dataenvironment.connection.execute "Insert Into De= tail (FK, Field1, Field2,
> FieldN) Values (" & header.recordset!= PK & "," & intData1 & "," & intData2 &
> ," &= ; intDataN & ")"
>
> Any suggestions?
>
> Tha= nk you in advanced,
>
>
> MAGO


_____________= _____________________
Do you Yahoo!?
Yahoo! Calendar - Free online ca= lendar with sync to Outlook(TM).
h= ttp://calendar.yahoo.com
____________________________= _____________________________________
3D""  IncrediMail - El E-m= ail ha evolucionado finalmente - Haga clic aqu=ED
--------------Boundary-00=_LXSD24L0000000000000-- --------------Boundary-00=_KXSD7TH0000000000000 Content-Type: image/gif; name="IMSTP.gif" Content-Transfer-Encoding: base64 Content-ID: R0lGODlhFAAPALMIAP9gAM9gAM8vAM9gL/+QL5AvAGAvAP9gL////wAAAAAA AAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQJFAAIACwA AAAAFAAPAAAEVRDJSaudJuudrxlEKI6BURlCUYyjKpgYAKSgOBSCDEuGDKgr AtC3Q/R+hkPJEDgYCjpKr5A8WK9OaPFZwHoPqm3366VKyeRtE30tVVRscMHD qV/u+AgAIfkEBWQACAAsAAAAABQADwAABBIQyUmrvTjrzbv/YCiOZGmeaAQA IfkECRQACAAsAgABABAADQAABEoQIUOrpXIOwrsPxiQUheeRAgUA49YNhbCq K1kS9grQhXGAhsDBUJgZAL2Dcqkk7ogFpvRAokSn0p4PO6UIuUsQggSmFjKX dAgRAQAh+QQFCgAIACwAAAAAFAAPAAAEEhDJSau9OOvNu/9gKI5kaZ5oBAAh +QQJFAAIACwCAAEAEAANAAAEShAhQ6ulcg7Cuw/GJBSF55ECBQDj1g2FsKor WRL2CtCFcYCGwMFQmBkAvYNyqSTuiAWm9ECiRKfSng87pQi5SxCCBKYWMpd0 CBEBACH5BAVkAAgALAAAAAAUAA8AAAQSEMlJq7046827/2AojmRpnmgEADs= --------------Boundary-00=_KXSD7TH0000000000000--