X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id A7B2B11F60E5 for ; Fri, 31 Mar 2006 10:00:36 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 27173-08 for ; Fri, 31 Mar 2006 10:00:36 -0400 (AST) Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id 71B0B11F6774 for ; Fri, 31 Mar 2006 10:00:34 -0400 (AST) Received: from geosys.fr (mail.geosys.com [195.115.79.21]) by svr4.postgresql.org (Postfix) with ESMTP id 51A545AF9CE for ; Fri, 31 Mar 2006 14:00:34 +0000 (GMT) Received: from [192.168.1.69] tc@geosys.fr [195.115.79.17] by geosys.fr with NetMail SMTP Agent $Revision: 3.16 $ on Microsoft Windows; Fri, 31 Mar 2006 15:04:25 +0100 Message-ID: <442D35FD.2050208@geosys.fr> Date: Fri, 31 Mar 2006 16:00:29 +0200 From: Thomas Chabaud Reply-To: tc@geosys.fr Organization: Geosys User-Agent: Thunderbird 1.5 (Windows/20051201) MIME-Version: 1.0 To: pgsql-odbc@postgresql.org Subject: Strange Update query ... Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[none] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200603/234 X-Sequence-Number: 7520 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