From: Thomas Chabaud <tc@geosys.fr>
To: pgsql-odbc@postgresql.org
Subject: Strange Update query ...
Date: Fri, 31 Mar 2006 16:00:29 +0200
Message-ID: <442D35FD.2050208@geosys.fr> (raw)
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 )'
I wonder why the odbc driver add those "AND ..." statement, because I think
they are useless, and they fail my rs.update
I use the following connection parameters :
DRIVER={PostgreSQL
ANSI};DATABASE=mydb;SERVER=localhost;PORT=5432;SSLMODE=prefer;UID=postgres;PWD=XXXXXXXXX;
ReadOnly=0;FakeOidIndex=0;ShowOidColumn=1;RowVersioning=1;ShowSystemTables=0;ConnSettings=;
Fetch=10000;Socket=4096;UnknownSizes=0;MaxVarcharSize=254;MaxLongVarcharSize=32767;
Debug=0;CommLog=1;Optimizer=1;Ksqo=0;UseDeclareFetch=0;TextAsLongVarchar=1;
UnknownsAsLongVarchar=1;BoolsAsChar=0;Parse=0;CancelAsFreeStmt=0;ExtraSysTablePrefixes=dd_;
LFConversion=1;UpdatableCursors=0;DisallowPremature=0;TrueIsMinus1=1;BI=0;ByteaAsLongVarBinary=0;
UseServerSidePrepare=0;LowerCaseIdentifier=0
Thanks in advance for your answers.
Regards,
Thomas
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: tc@geosys.fr
Subject: Re: Strange Update query ...
In-Reply-To: <442D35FD.2050208@geosys.fr>
References: <442D35FD.2050208@geosys.fr>
* 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