Re: Strange Update query ...

From: Hiroshi Inoue <inoue(at)tpf(dot)co(dot)jp>
To: tc(at)geosys(dot)fr
Cc: pgsql-odbc(at)postgresql(dot)org
Subject: Re: Strange Update query ...
Date: 2006-04-01 06:00:28
Message-ID: 442E16FC.3030607@tpf.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

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

In response to

Browse pgsql-odbc by date

  From Date Subject
Next Message Hiroshi Inoue 2006-04-01 06:30:52 Re: Error when getting text longer than MaxLongVarcharSize
Previous Message Hiroshi Inoue 2006-04-01 01:35:37 Re: Unicode is not UTF-8. was :psqlODBC-Driver Test / text