Skip site navigation (1) Skip section navigation (2)

Weird Update Behaviour

From: "Corey W(dot) Gibbs" <cgibbs(at)westmarkproducts(dot)com>
To: "pgsql-odbc(at)postgresql(dot)org" <pgsql-odbc(at)postgresql(dot)org>
Subject: Weird Update Behaviour
Date: 2002-03-16 00:08:11
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-odbc
Good Day Everyone,

Here's something weird
So, i'm using VB and ODBC and I'm getting something weird weird weird 
happening.  When ever a user updates this text field, it gets put all over 
the same column.

So if low_bid_notes.Text = "Talk about frustrating" when the With 
rs2.Update would execute, "Talk about frustrating" would appear all over 
that column, not just on the row where quote_number = 

but on anywhere from 15 to 50 other rows.

    rs2.Open "SELECT low_bid_notes,low_bid_spread,low_bid_spread_percent," 
& _
vail,only_bidder,negotiated,no_tabs," & _
ow_bid_percent_sell FROM schedule WHERE
    quote_number='" & data_estimating.Recordset!quote_number & "'", cn, 
adOpenKeyset, adLockPessimistic
cn is yer standard connection string that's worked time and time again.

With rs2
    .Fields("no_tabs").Value = chk_no_tabs
    .Fields("negotiated").Value = chk_negotiated
    .Fields("only_bidder").Value = chk_only_bid
    .Fields("dealer_bid").Value = chk_dealer_bid

    .Fields("low_bid_percent_sell").Value = 
Format(txt_low_bid_percent_sell.Text, "general number")
    .Fields("low_bid_percent").Value = Format(txt_low_bid_percent.Text, 
"general number")
    .Fields("low_bid_notes").Value = txt_low_bid_notes.Text
    .Fields("low_bid_spread").Value = Format(txt_low_bid_spread.Text, 
"general number")
    .Fields("low_bid_spread_percent").Value = 
Format(txt_low_bid_spread_percent.Text, "general number")
    .Fields("date_modified") = Now()


that's the code that's broken, here's what i did to fix it:

cn.Execute "update schedule SET low_bid_notes='" & txt_low_bid_notes.Text & 
"'" & _
" ,low_bid_percent_sell ='" & Format(txt_low_bid_percent_sell.Text, 
"general number") & "'" & _
" WHERE quote_number = '" & txt_quote_id(0).Text & "'"

instead of using the ADO recordset, i just did an execute command on the cn 
connection.  when done like that, it works just fine.

So, my questions are:
What could cause this?  Is it an ADO or ODBC thing?  Am i forgetting to 
close or set a recordset to nothing somewhere?  Thanks in advance and have 
a good weekend.

pgsql-odbc by date

Next:From: Keith GrayDate: 2002-03-17 22:00:52
Subject: Re: replacing multi-table-queries-bound-forms by view-bound forms
Previous:From: KBR Immobilien GmbHDate: 2002-03-15 10:26:34
Subject: replacing multi-table-queries-bound-forms by view-bound forms

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group