Re: EditMode gets reset to adEditNone when adding multiple records



Sven De Bont wrote:
Hello all,

I recently took over a VB6 application and I need to make some
changes to it. It's a 3-tier application using COM+ (originally MTS)
and an MS SQL database 2000. It uses MDAC version 2.8

The Middle Tier retrieves data from the database into ADO recordsets
and returns these to the clients. The recordsets have the following
specs:

CursorLocation = adUseClient
CursorType = adOpenStatic
Since you are using adUseClient, adOpenStatic is the ONLY cursor type you
will have. No other cursor type is supported by the ADO cursor library
(adUseClient)


LockType = adLockBatchOptimistic

In the new feature I'm adding, the client should be able to add
multiple records to the recordset and send it back to the Middle Tier
when done.

Whenever the clients adds more than one record to the recordset, only
the last added record is saved to the database.

Does this occur when you are debugging the application? Or only when a
client is using a compiled version?


After I took a closer look, I found that the other added records were
still in the recordset, but had their EditModeproperty reset to
adEditNone (so calling UpdateBatch has no effect on these records).

I can't figure out where exactly the EditMode gets reset.


If this is occuring during the debugging process, you might try scattering
some debug.assert statements throught the code so you can narrow down where
this is occurring.

Does anyone have any idea what could cause the editmode property
getting reset to adEditNone?

None. I am assuming you are using disconnected recordsets and calling the
Update method after adding the records, correct?
Could you provide a small repro to allow us to test it ourselves?

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


.



Relevant Pages

  • Re: Tom Ogilvys VBA code
    ... therefore frequency variable value will increment to 2. ... Reset frequency value to 0. ... Offset the cursor to V2 again and reset the frequency value ...
    (microsoft.public.excel.programming)
  • Re: Confused obout setting a Cursor
    ... I'm thinking about nested routines all setting it to true. ... Since it is boolean I'd guess the cursor gets reset on all open forms even ... If C1 is an instance of a Control: ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: [opensuse] Resetting xterm?
    ... Any other possibility to reset it? ... Since I use a black background by default, the cursor is changed - mostly due ... Is it an xterm bug? ...
    (SuSE)
  • Re: BeginWaitCursor() does not work effectively?
    ... BeginWaitCursor does a SetCursor, and it assumes that no other SetCursor will be done ... until you reset the cursor yourself. ... reset it at your earliest opportunity". ... A better strategy would be to have your OnOK handler launch a thread, disable the dialog, ...
    (microsoft.public.vc.mfc)
  • SV: Fox2.6 -> _Visual Fox 8.0
    ... FROM Clients C, Orders O; ... WHERE C.code=O.code INTO CURSOR Q1 ... > Marv (AAABAB) ... > these clients (Milly, Marv, Jenna, Chasey) ...
    (microsoft.public.fox.programmer.exchange)