strange behavior - Mailing list pgsql-odbc

From Patrick Hatcher
Subject strange behavior
Date
Msg-id OF1D873D30.15D9B6F6-ON88256DE9.0074C626-88256DE9.00777164@fds.com
Whole thread Raw
List pgsql-odbc
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?


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


TIA

Patrick Hatcher



pgsql-odbc by date:

Previous
From: "Ropel"
Date:
Subject: Re: MS Access, Unicode, Conversions & Foreign languages characters
Next
From: Andrew Ayers
Date:
Subject: Re: strange behavior