Error -2147217885 using ODBC ADO VB and Oracle

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
LVL 1
FrankStanssensAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
mdouganConnect With a Mentor Commented:
Sorry, I think I meant ReQuery.  Did you try opening the cursor as a keyset instead of static?
0
 
COAtheGREATCommented:
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
 
FrankStanssensAuthor Commented:
I have to use ODBC and cursor location is client side
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
COAtheGREATCommented:
Did you check errors after UpdateBatch, I mean if you have on error resume next or something like that.
0
 
FrankStanssensAuthor Commented:
yes, i did check them
in my recordset there aren't any records anymore and i need that ID
0
 
FrankStanssensAuthor Commented:
Ryan,

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

Thanks for your efforts

Frank
0
 
COAtheGREATCommented:
try .Resync after update
0
 
FrankStanssensAuthor Commented:
already tried that
doesn't work
0
 
COAtheGREATCommented:
try
.LockType = adLockOptimistic
0
 
COAtheGREATCommented:
with .Resync I mean
0
 
mdouganCommented:
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
 
FrankStanssensAuthor Commented:
it says recordset supports both
0
 
mdouganCommented:
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
 
FrankStanssensAuthor Commented:
Refresh isn't a method of the recordset object.
and Resync doesn't work neither
0
 
twalgraveCommented:
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
 
SpideyModCommented:
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.