pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Hiroshi Inoue <inoue@tpf.co.jp>
To: tc@geosys.fr
Cc: pgsql-odbc@postgresql.org
Subject: Re: Strange Update query ...
Date: Sat, 01 Apr 2006 15:00:28 +0900
Message-ID: <442E16FC.3030607@tpf.co.jp> (raw)
In-Reply-To: <442D35FD.2050208@geosys.fr>
References: <442D35FD.2050208@geosys.fr>

Thomas Chabaud wrote:
> Hello,
> I have a problem with update on recordset with Visual Basic 6.
> 
> I'm using the recordset as following :
> 
>   Set rs = New ADODB.Recordset
>   rs.Open "SELECT id,myfield1,myfield2,myfield3 from mytable where 
> id=6",dbConn, adOpenKeyset, adLockOptimistic, adCmdText
> 
>   rs("myfield1").value = myvalue1
>   rs("myfield2").value = myvalue2
>   rs("myfield3").value = myvalue3
>   rs.Update
>   rs.close
>   set rs=Nothing
> 
> But the line is not updated, so I checked the log, and I saw that the 
> query which was generated by odbc driver is :
> 
> UPDATE mytable SET myfield1=myvalue1,myfield2=myvalue2,myfield3=myvalue3 
> WHERE (id=6 AND myfield1=myvalue1 AND myfield2=myvalue2 AND 
> myfield3=myvalue3 )'

Are they really myvalue..s not oldvalue..s after the "AND .." ?

> I wonder why the odbc driver add those "AND ..." statement, because I 
> think they are useless, and they fail my rs.update

AFAIK the ODBC driver doesn't add them. Maybe ado does it.

regards,
Hiroshi Inoue



view thread (6+ messages)  latest in thread

Message-ID: <442E16FC.3030607@tpf.co.jp>
Permalink:  ../442E16FC.3030607@tpf.co.jp/
Also on:    postgresql.org/message-id/442E16FC.3030607@tpf.co.jp

 · 

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: inoue@tpf.co.jp, tc@geosys.fr
  Subject: Re: Strange Update query ...
  In-Reply-To: <442E16FC.3030607@tpf.co.jp>
  References: <442D35FD.2050208@geosys.fr> <442E16FC.3030607@tpf.co.jp>

* 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