Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Error -2147217885 using ODBC ADO VB and Oracle

Posted on 2002-03-29
17
Medium Priority
?
909 Views
Last Modified: 2007-11-27
Hi,

I'm having a problem here with disconnected recordsets.
The key is a sequence in Oracle and i use the Microsoft ODBC driver for Oracle

First part:

        With rsDefinition
          .CursorLocation = adUseClient
          .Properties("Update Criteria").Value = adCriteriaAllCols
          .Properties("Update Resync").Value = adResyncInserts Or adResyncUpdates Or adResyncAutoIncrement
          .Open strSQL, DB_CONNECT, adOpenStatic, adLockBatchOptimistic
          Set .ActiveConnection = Nothing
        End With

Second part:
        rsDefinition.AddNew
        'fill the fields

Third part:
        .ActiveConnection = conRDBMS
        .UpdateBatch

Normally i should have now in that recordset the record with the new PK. Unfortunatelay it doesn't do that.
When i look at some properties of the recordset they say:
"Row handle referred to a deleted row or a row marked for deletion."
Giving error number -2147217885

How do i solve that? Has it something to do with the ODBC driver?

Greetings,

Frank
0
Comment
Question by:FrankStanssens
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5
  • 3
  • +3
17 Comments
 
LVL 1

Expert Comment

by:COAtheGREAT
ID: 6904677
If i remember well Oracle dosn't seport all types of cursors that ADO provides, and OLEDB is beterr choise.

So you should check if the cursorlocation is clientside for the begining.
0
 
LVL 1

Author Comment

by:FrankStanssens
ID: 6904684
I have to use ODBC and cursor location is client side
0
 
LVL 1

Expert Comment

by:COAtheGREAT
ID: 6904692
Did you check errors after UpdateBatch, I mean if you have on error resume next or something like that.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

by:FrankStanssens
ID: 6904709
yes, i did check them
in my recordset there aren't any records anymore and i need that ID
0
 
LVL 1

Author Comment

by:FrankStanssens
ID: 6904710
Ryan,

i saw those articles too but they don't give a solution to my problem

Thanks for your efforts

Frank
0
 
LVL 1

Expert Comment

by:COAtheGREAT
ID: 6904720
try .Resync after update
0
 
LVL 1

Author Comment

by:FrankStanssens
ID: 6904731
already tried that
doesn't work
0
 
LVL 1

Expert Comment

by:COAtheGREAT
ID: 6904754
try
.LockType = adLockOptimistic
0
 
LVL 1

Expert Comment

by:COAtheGREAT
ID: 6904759
with .Resync I mean
0
 
LVL 18

Expert Comment

by:mdougan
ID: 6905068
Try adOpenDynamic or adOpenKeyset instead of adOpenStatic

Also, after a recordset is opened, as was mentioned, your provider may not support all of the things that you requested.  So, it's helpful to call the Recordset's Supports method to check to see how the cursor was actually opened.

If RS.Supports(adResync) Then MsgBox "Recordset supports resync"
If RS.Supports(adUpdateBatch) Then MsgBox "Recordset supports UpdateBatch"

etc.
0
 
LVL 1

Author Comment

by:FrankStanssens
ID: 6912040
it says recordset supports both
0
 
LVL 18

Expert Comment

by:mdougan
ID: 6916820
Are you issuing a rsDefinition.Resync adAffectAll after the update?  If not, try that first.  If so, then this
might be the answer:

Unlike the Refresh method, the Resync method does not re-execute the Recordset object's underlying command; new records in the underlying database will not be visible.

Now, they're probably saying that new records inserted by other users wont be visible, but, I suppose that if you inserted records, resynch may not know to "refresh" the new record.

I'd say that you'll need to issue a .Refresh instead of a .Resync if Resync is not working for you.
0
 
LVL 1

Author Comment

by:FrankStanssens
ID: 6917368
Refresh isn't a method of the recordset object.
and Resync doesn't work neither
0
 
LVL 18

Accepted Solution

by:
mdougan earned 400 total points
ID: 6917823
Sorry, I think I meant ReQuery.  Did you try opening the cursor as a keyset instead of static?
0
 
LVL 16

Expert Comment

by:twalgrave
ID: 7754874
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in Community Support that this question is:
- points to mdougan
Please leave any comments here within the
next seven days.
0
 

Expert Comment

by:SpideyMod
ID: 7811816
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question