We help IT Professionals succeed at work.

connection.execute "SAVEPOINT asavepoint" in VB doesn't create a savepoint?

ceds98 asked
I use VB and ORACLE. I'd like to set a savepoint in order to rollback to that savepoint. I tried savepoint and rollback command in PL/SQL. They work fine. But when I code in VB I got the error message "Run-time error'-2147217900(80040e14)':
ORA-01086: savepoint 'ASAVEPOINT' never established

Does VB support "SAVEPOINT"?

This is my code.
Option Explicit
Public rs As New ADODB.Recordset
Public mdkcmd As New ADODB.Command
Public conn As New ADODB.Connection
Public myobj As Object

Public Sub OpenConn()
With conn
.CursorLocation = adUseClient
.ConnectionString= "Provider=OraOLEDB.Oracle.1;Password=infs7905gE;Persist Security Info=True;User ID=infs7905gE;Data Source=TEACH"

End With

End Sub

Private Sub cmdImport_click()
On Error GoTo errorhandle
    conn.Execute "SAVEPOINT asavepoint"
    'read file and insert into table
Exit Sub
    'if the format of file is unacceptable
    conn.Execute "ROLLBACK TO SAVEPOINT asavepoint"
Exit Sub
End Sub
Watch Question

Senior Tech Consultant

Have a look at this:

(HOWTO: Implement Nested Transactions with Oracle)
Author of the Year 2009

Hi ceds98,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept valli_an's comment(s) as an answer.

ceds98, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.
DanRollins -- EE database cleanup volunteer
Per recommendation, force-accepted.

CS Moderator

Explore More ContentExplore courses, solutions, and other research materials related to this topic.