Solved

Error -2147217885 using ODBC ADO VB and Oracle

Posted on 2002-03-29
17
878 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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
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…

786 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