We help IT Professionals succeed at work.

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

ceds98
ceds98 asked
on
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"
.Open

End With

End Sub
-------------------------------------------------------

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

Senior Tech Consultant
CERTIFIED EXPERT
Commented:

Have a look at this:

http://support.microsoft.com/support/kb/articles/q187/2/89.asp?FR=0
(HOWTO: Implement Nested Transactions with Oracle)
CERTIFIED EXPERT
Author of the Year 2009

Commented:
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.

Netminder
CS Moderator

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