D
Dave
I have the following code that runs from a form. It works in the original
database but when I make a new database and copy the statement to a new form
and run the form an error message appears in the VB window: "Compile Error,
Invalid use of New Keyword" refering to "Set cnMarvin = New Connection" in
the script.
Thank you
Dave
Private Sub cmdDelete_Click()
' declare and instantiate the object variables
Dim cnMarvin As Connection
Set cnMarvin = New Connection
Dim rsLSS As Recordset
Set rsLSS = New Recordset
Dim comExecute As Command
Set comExecute = New Command
' connect to MARVIN
With cnMarvin
.Provider = "MSDASQL"
.ConnectionString = "DRIVER={Microsoft ODBC for
Oracle};UID=XXXXXX;SERVER=dmrprod;Password=XXXXXX"
.Open
End With
database but when I make a new database and copy the statement to a new form
and run the form an error message appears in the VB window: "Compile Error,
Invalid use of New Keyword" refering to "Set cnMarvin = New Connection" in
the script.
Thank you
Dave
Private Sub cmdDelete_Click()
' declare and instantiate the object variables
Dim cnMarvin As Connection
Set cnMarvin = New Connection
Dim rsLSS As Recordset
Set rsLSS = New Recordset
Dim comExecute As Command
Set comExecute = New Command
' connect to MARVIN
With cnMarvin
.Provider = "MSDASQL"
.ConnectionString = "DRIVER={Microsoft ODBC for
Oracle};UID=XXXXXX;SERVER=dmrprod;Password=XXXXXX"
.Open
End With