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 5D1D211F6B01 for ; Sat, 1 Apr 2006 02:00:59 -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 81501-07 for ; Sat, 1 Apr 2006 02:00:57 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sd.tpf.co.jp (smtp.tpf.co.jp [210.161.239.34]) by postgresql.org (Postfix) with SMTP id 739C311F6AFF for ; Sat, 1 Apr 2006 02:00:55 -0400 (AST) Received: (qmail 25299 invoked from network); 1 Apr 2006 15:00:54 +0900 Received: from unknown (HELO ?100.0.32.254?) (100.0.32.254) by sd2.tpf-fw-c.co.jp with SMTP; 1 Apr 2006 15:00:54 +0900 Message-ID: <442E16FC.3030607@tpf.co.jp> Date: Sat, 01 Apr 2006 15:00:28 +0900 From: Hiroshi Inoue User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: ja, en-us, en MIME-Version: 1.0 To: tc@geosys.fr CC: pgsql-odbc@postgresql.org Subject: Re: Strange Update query ... References: <442D35FD.2050208@geosys.fr> In-Reply-To: <442D35FD.2050208@geosys.fr> 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=1.918 required=5 tests=[AWL=0.107, RCVD_IN_WHOIS_BOGONS=1.811] X-Spam-Score: 1.918 X-Spam-Level: * X-Archive-Number: 200604/1 X-Sequence-Number: 7528 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