Re: VB Resync

From: "MRGonzalez" <magotemp(at)hotmail(dot)com>
To: <cgg007(at)yahoo(dot)com>, <pgsql-odbc(at)postgresql(dot)org>
Subject: Re: VB Resync
Date: 2003-06-12 18:34:32
Message-ID: 3EE8C7B8.00000C.01780@GUAJ215DESA
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

Thank you, it works.

Now, I have a single ADO control bound to my table "clients".
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-------

De: cgg007(at)yahoo(dot)com
Fecha: Jueves, 12 de Junio de 2003 10:01:52 a.
A: MRGonzalez; pgsql-odbc(at)postgresql(dot)org
Asunto: Re: [ODBC] VB Resync

If you're application is designed to run only with PostgreSQL, let
PostgreSQL
keep track of the current value of the serial:

dataenvironment.connection.execute "Insert Into Detail (FK, Field1, Field2,
FieldN) select currval('whatever_the_PK\'s_sequence_name'),'" & intData1 &
"','" & intData2 & "','" & intDataN & "');"

HTH

--- MRGonzalez <magotemp(at)hotmail(dot)com> wrote:
> I have an application where I save the information of a bill and its
detail.
> The PK of the header its a serial.
>
> I need to save the header and get the number of the serial to save it as a
> FK in the detail.
>
> This is the way I wrote but it raise an error:
>
> header.recordset.update
> header.recordset.resync adAffectCurrent, adResyncAllValues
>
> dataenvironment.connection.execute "Insert Into Detail (FK, Field1, Field2

> FieldN) Values (" & header.recordset!PK & "," & intData1 & "," & intData2
&
> ," & intDataN & ")"
>
> Any suggestions?
>
> Thank you in advanced,
>
>
> MAGO

__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

In response to

Responses

Browse pgsql-odbc by date

  From Date Subject
Next Message Chris Gamache 2003-06-12 21:32:58 Re: VB Resync
Previous Message Chris Gamache 2003-06-12 16:01:46 Re: VB Resync