Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ADO Execute, doing nothing

Status
Not open for further replies.

MatDavies

Programmer
Feb 22, 2001
243
GB
Hi guys 'n gals.

I have an ADO connection to an oracle 8 database. I am trying to run some sql over this connection to rebuild a package.
The connection is declared withevents so I can use the ExecuteComplete event.

The problem is that the ExecuteComplete is reporting success but nothing is happening in the database.

Any ideas?

The code I am using ...

Code:
Option Explicit

Private WithEvents cn As ADODB.Connection

Private Sub cn_ExecuteComplete(ByVal RecordsAffected As Long, ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pCommand As ADODB.Command, ByVal pRecordset As ADODB.Recordset, ByVal pConnection As ADODB.Connection)
    Select Case adStatus
        Case Is = adStatusOK
            MsgBox "Completed Ok"
            cn.CommitTrans
        Case Is = adStatusErrorsOccurred
            MsgBox pError.Number & "- " & pError.Description
        Case Else
            Stop
    End Select
End Sub

Private Sub Command1_Click()
    Set cn = New ADODB.Connection
    cn.ConnectionString = "Provider=OraOLEDB.Oracle.1;Password=pulse;Persist Security Info=True;User ID=csl32;Data Source=saturn"
    cn.Open
    
    cn.BeginTrans
    cn.Execute text1.Text, , adAsyncExecute

End Sub

This is on a form with a single command button and a text box(multiline). This is a basic 'test the theory' app.

any help appreciated!

Matt

If you can keep your head while those around you are losing theirs, you obviously haven't grasped the seriousness of the situation
 
I don't use Oracle much, but you have a BeginTrans but no Commit

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'If we're supposed to work in Hex, why have we only got A fingers?'
 
The committrans is in the ExecuteComplete procedure, if success is returned.

I tried it after the execute call but it didn't work there either. I thought it best to confirm success before calling commit.

thanks though.

Matt

If you can keep your head while those around you are losing theirs, you obviously haven't grasped the seriousness of the situation
 
Ok, seems it was my machine being strange. After a reboot it is working.

Matt

If you can keep your head while those around you are losing theirs, you obviously haven't grasped the seriousness of the situation
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top