pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Ayers <aayers@eldocomp.com>
To: pgsql-odbc@postgresql.org <pgsql-odbc@postgresql.org>
Subject: Re: strange behavior
Date: Tue, 25 Nov 2003 16:04:40 -0700
Message-ID: <3FC3E008.60103@eldocomp.com> (raw)

Patrick Hatcher wrote:
> ODBC: 7.03.02
> App: Visual Basics 6
> Pg: 7.3.3 (same problem on 7.4)
> 
> 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 matter
> 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):
> 
> Set rsBASADDs = New ADODB.Recordset
> 
> rsBASADDs.Open "Select oid,* from PREP order by dept, vend,mstyle", Conn1,
> adOpenDynamic, adLockOptimistic, adCmdText
> 
> If rsBASADDs.BOF And rsBASADDs.EOF Then
>     CloseTimer
> End If
> 
> 
> rsBASADDs.MoveFirst
> 
> Do While Not rsBASADDs.EOF
> 
>          If (rsBASADDs.Fields("nrfcolorcode") = Null Or
> Val(rsBASADDs.Fields("nrfcolorcode")) = 0) And _
>          (rsBASADDs.Fields("nrfsizecode") = Null Or Val(rsBASADDs.Fields
> ("nrfsizecode")) = 0) Then
>             NoColorSizeStyle = True
>             rsBASADDs.Fields("mwcolorcode") = "00"
>             rsBASADDs.Fields("mwsizecode") = "000"
>             'rsBASADDs.Fields("mwsizerange") = "000"
>             rsBASADDs.Fields("status") = "NON CS STYLE"
> 
>        End If
> 
>         rsBASADDs.Update
>         x = x + 1
>         Debug.Print rsBASADDs.Fields("oid") & " - " & x
>         rsBASADDs.MoveNext
> Loop

Have you tried moving the Update inside of the If-Then expression? 
Because you only need to perform the Update if you have changed the 
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 whom it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended addressee, nor authorized to receive for the intended addressee, you are hereby notified that you may not use, copy, disclose or distribute to anyone the message or any information contained in the message. If you have received this message in error, please immediately advise the sender by reply email, and delete the message. Thank you.



view thread (5+ messages)  latest in thread

Message-ID: <3FC3E008.60103@eldocomp.com>
Permalink:  ../3FC3E008.60103@eldocomp.com/
Also on:    postgresql.org/message-id/3FC3E008.60103@eldocomp.com

 · 

reply

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: aayers@eldocomp.com
  Subject: Re: strange behavior
  In-Reply-To: <3FC3E008.60103@eldocomp.com>
  References: <3FC3E008.60103@eldocomp.com>

* 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