Solved

Error -2147217885 using ODBC ADO VB and Oracle

Posted on 2002-03-29
17
885 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
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

829 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