2nd SQL Server update after update text field corrupts row - using RDO 
Author Message
 2nd SQL Server update after update text field corrupts row - using RDO

I've got a 6.5 sp2 database with a table containing many normal fields
and 3 textfields.

If I modify the normal fields using an UPDATE query, all goes well.

If I modify one of the text fields, the next time I run the stored
procedure I use to lock the record with my custom lock field (which
doesn't modify any memo fields), the row becomes corrupted.  The
timestamp field becomes NULL and some keys end up with trash
characters.

This behavior only began after I added some text fields.  I am at a
loss.

The code that I use to update the record (bill address is a text
field) looks like:

update tSite SET billAddress='xxxxafafadfadfadfafadf' ,revDate =
'3/19/97' ,lockUser = NULL,lockWs = NULL,lockTime = NULL where siteCtr
= 5 and tsequal(siteTs, convert(binary(8),
convert(money,429499.5888)))

which is called using code like:

    Set ps = cn.CreatePreparedStatement("prSaveSite", sql)
    ps.Execute

The stored procedure is as follows:

CREATE PROCEDURE prLockSite

)
as





        from tSite



begin
        raiserror (55000, 1,1)
        return 1
end


        begin
                raiserror(55001, 1, 1)
                return 1
        end

UPDATE tSite





begin

        from tSite

end

-- if there is an error in select, will return that or a
-- 0 for success

GO

I am calling the prLockSite procedure like:

    Dim sql$

    sql = "{ ? = call prLockSite  (?, ?, ?, ?, ?) }"
    'rdoEngine.rdoDefaultErrorThreshold = 16

    Set ps = cn.CreatePreparedStatement("prLockSite", sql)
    ps.rdoParameters(0).Direction = rdParamReturnValue
    ps.rdoParameters(1) = siteCtr
    ps.rdoParameters(2) = siteTs ' 429498.2278
    ps.rdoParameters(3) = GetCurrentUser ' "userName"
    ps.rdoParameters(4) = GetCurrentWs ' "wsName"
    ps.rdoParameters(5).Direction = rdParamReturnValue

    ps.Execute

How can I make my database work with these text fields?  I don't
understand how SQL Server can corrupt a row.  This sounds like a bug
to me.  Are there some workarounds so that I can get text fields to
work?
--



Mon, 06 Sep 1999 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Using RDO to do SQL updates on SQL Server 6.0

2. Updating data to a memo field using SQL UPDATE

3. RDO buffer doesnt refresh when manually update row via SQL script

4. SQL Server Update with RDO

5. RDO, SQL Server and error on Update

6. SQL Server Update Error with RDO

7. SQL Server Update with RDO

8. Simple update to a row in a table in a SQL Server database

9. Error: 40002 - 01S03: [Microsoft][ODBC SQL Server Driver]No rows updated or deleted

10. Error : 40002 - 01S03: [Microsoft][ODBC SQL Server Driver]No rows updated or deleted

11. Simple update to a row in a table in an SQL Server database

12. SQL Server-Access: Update 1000 Rows

 

 
Powered by phpBB® Forum Software