D
Dave
Hi,
The code below connects to an Oracle database and executes an Oracle
procedure. This works when developed in original Access db. When another db
is created and the code is copied from the original to the new db and
executed the following Compile error appears: "Invalid use of New Keyword"
for this line:
Set cnMarvin = New Connection
What is needed to reset this instance?
Thank you
Dave
Private Sub Form_Close()
'declare and instantiate the object variables
Dim cnMarvin As Connection
Set cnMarvin = New Connection
Dim rsMLP As Recordset
Set rsMLP = New Recordset
Dim comExecute As Command
Set comExecute = New Command
' connect to MARVIN
With cnMarvin
.Provider = "MSDASQL"
.ConnectionString = "DRIVER={Microsoft ODBC for
Oracle};UID=???????;SERVER=dmrprod;Password=??????"
.Open
End With
comExecute.ActiveConnection = cnMarvin
comExecute.CommandText = "begin marvin.Procedure; end;"
Set rsMLP = comExecute.Execute
comExecute.CommandText = "commit"
Set rsMLP = comExecute.Execute
cnMarvin.Close
End
End Sub
The code below connects to an Oracle database and executes an Oracle
procedure. This works when developed in original Access db. When another db
is created and the code is copied from the original to the new db and
executed the following Compile error appears: "Invalid use of New Keyword"
for this line:
Set cnMarvin = New Connection
What is needed to reset this instance?
Thank you
Dave
Private Sub Form_Close()
'declare and instantiate the object variables
Dim cnMarvin As Connection
Set cnMarvin = New Connection
Dim rsMLP As Recordset
Set rsMLP = New Recordset
Dim comExecute As Command
Set comExecute = New Command
' connect to MARVIN
With cnMarvin
.Provider = "MSDASQL"
.ConnectionString = "DRIVER={Microsoft ODBC for
Oracle};UID=???????;SERVER=dmrprod;Password=??????"
.Open
End With
comExecute.ActiveConnection = cnMarvin
comExecute.CommandText = "begin marvin.Procedure; end;"
Set rsMLP = comExecute.Execute
comExecute.CommandText = "commit"
Set rsMLP = comExecute.Execute
cnMarvin.Close
End
End Sub