Solved

Error -2147217885 using ODBC ADO VB and Oracle

Posted on 2002-03-29
17
888 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
  • 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

Expert Comment

by:Ryan_231
ID: 6904701
0
 
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 100 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

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

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

726 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