X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id D906CD1B470 for ; Tue, 25 Nov 2003 23:05:11 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 50542-07 for ; Tue, 25 Nov 2003 19:04:41 -0400 (AST) Received: from ecintweb.eldocomp.com (ecintweb.eldocomp.com [205.159.99.8]) by svr1.postgresql.org (Postfix) with ESMTP id 3FA51D1B439 for ; Tue, 25 Nov 2003 19:04:39 -0400 (AST) Received: by ecintweb.eldocomp.com with XWall v3.28 ; Tue, 25 Nov 2003 16:04:41 -0700 From: Andrew Ayers To: "pgsql-odbc@postgresql.org" Subject: Re: strange behavior Date: Tue, 25 Nov 2003 16:04:40 -0700 X-Assembled-By: XWall v3.28 Message-ID: <3FC3E008.60103@eldocomp.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200311/111 X-Sequence-Number: 3513 Patrick Hatcher wrote: > ODBC: 7.03.02 > App: Visual Basics 6 > Pg: 7.3.3 (same problem on 7.4) >=20 > I'm having a problem I cannot figure out. I have code that reads through= a > recordset and makes necessary updates to fields and then updates the > record. For some reason, the process always stops at record 99. No matt= er > what happens, it stops while trying to do rs.MOVENEXT and freezes my app. > What I do notice is that if I remove the code between the Do and MOVENEXT, > the entire recordset is read without issue. Am I missing something? Do I > need to clear some variable out? Strange... > Here's a snippet of my code (it looks suspiciously like the example > provided on the website): >=20 > Set rsBASADDs =3D New ADODB.Recordset >=20 > rsBASADDs.Open "Select oid,* from PREP order by dept, vend,mstyle", Conn1, > adOpenDynamic, adLockOptimistic, adCmdText >=20 > If rsBASADDs.BOF And rsBASADDs.EOF Then > CloseTimer > End If >=20 >=20 > rsBASADDs.MoveFirst >=20 > Do While Not rsBASADDs.EOF >=20 > If (rsBASADDs.Fields("nrfcolorcode") =3D Null Or > Val(rsBASADDs.Fields("nrfcolorcode")) =3D 0) And _ > (rsBASADDs.Fields("nrfsizecode") =3D Null Or Val(rsBASADDs.Fields > ("nrfsizecode")) =3D 0) Then > NoColorSizeStyle =3D True > rsBASADDs.Fields("mwcolorcode") =3D "00" > rsBASADDs.Fields("mwsizecode") =3D "000" > 'rsBASADDs.Fields("mwsizerange") =3D "000" > rsBASADDs.Fields("status") =3D "NON CS STYLE" >=20 > End If >=20 > rsBASADDs.Update > x =3D x + 1 > Debug.Print rsBASADDs.Fields("oid") & " - " & x > rsBASADDs.MoveNext > Loop Have you tried moving the Update inside of the If-Then expression?=20 Because you only need to perform the Update if you have changed the=20 record (not every record). Can't see anything else you are doing wrong, offhand... Andrew L. Ayers -- CONFIDENTIALITY NOTICE -- This message is intended for the sole use of the individual and entity to w= hom it is addressed, and may contain information that is privileged, confid= ential and exempt from disclosure under applicable law. If you are not the = intended addressee, nor authorized to receive for the intended addressee, y= ou are hereby notified that you may not use, copy, disclose or distribute t= o anyone the message or any information contained in the message. If you ha= ve received this message in error, please immediately advise the sender by = reply email, and delete the message. Thank you.