pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Chris Gamache <cgg007@yahoo.com>
To: MRGonzalez <magotemp@hotmail.com>
To: pgsql-odbc@postgresql.org
Subject: Re: VB Resync
Date: Thu, 12 Jun 2003 09:01:46 -0700 (PDT)
Message-ID: <20030612160146.43015.qmail@web13806.mail.yahoo.com> (raw)
In-Reply-To: <3EE8A211.000003.01780@GUAJ215DESA>


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@hotmail.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



view thread (4+ messages)  latest in thread

Message-ID: <20030612160146.43015.qmail@web13806.mail.yahoo.com>
Permalink:  ../20030612160146.43015.qmail@web13806.mail.yahoo.com/
Also on:    postgresql.org/message-id/20030612160146.43015.qmail@web13806.mail.yahoo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: cgg007@yahoo.com, magotemp@hotmail.com
  Subject: Re: VB Resync
  In-Reply-To: <20030612160146.43015.qmail@web13806.mail.yahoo.com>
  References: <3EE8A211.000003.01780@GUAJ215DESA> <20030612160146.43015.qmail@web13806.mail.yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox