Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Differing Results between Record binding (C++) and Collect method

Differing Results between Record binding (C++) and Collect method

Scheduled Pinned Locked Moved Database
c++databasesql-serverwpfwcf
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Stone Free
    wrote on last edited by
    #1

    Hi, I have some code where the dataset being modified is the result of a JOIN between two tables. The key of the first table is also a foreign key of the second table. There will be situations where the fields from the second table will be NULL and others when the alternate key on table two will match the primary key of table one. The record binding code works when the alternate key is not NULL, but when it and the second tables fields are NULL then the UpdateBatch gives the error "Row cannot be located for updating. Some values may have been changed since it was last read." This is not true as this is a) not a multi-user system and b) nothing has changed. I have dumped all the values in the record set - Value, OriginalValue and UnderlyingValue. All the fields of the second table are showing up as NULL for all of the value types. All the other fields values are identical apart from Value for the attribute on the first table being updated. I have status values for all the fields from the second table and they are all set to adFldNull. If I then swap to using the Collect method then no error occurs. The connection has the following properties: Provider = oledb (Server is SQL Server 2000) CursorLocation = adUseClient IsolationLevel = adXactReadCommitted ConnectionMode = adModeRead | adModeWrite | adModeShareDenyRead | adModeShareDenyWrite | adModeShareExclusive The recordset properties are: CursorLocation = adUseClient CursorType = adOpenStatic LockType = adLockBatchOptimistic MarshalOptions = adMarshalModifiedOnly Any ideas other than swapping to using the Collect method?

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups