For years I have been using this to connect to ORACLE:
(With Reference to Microsoft ActiveX Data Object X.X Library)
And then to create some recordsets:
Where strSQL is my Select statement(s).
For Insert, Delete, or Update I use:
Now, do I use all settings in [blue]BLUE[/blue] correct?
I think some Connection settings set also the recordset settings (is that right?) so maybe I don't need to do some of this (blue) stuff...?
Have fun.
---- Andy
(With Reference to Microsoft ActiveX Data Object X.X Library)
Code:
Public Cn As ADODB.Connection
Set Cn = New ADODB.Connection
Cn.ConnectionString = "Some connect string here"
Cn.CursorLocation = [blue]adUseNone[/blue]
Cn.Open
...
And then to create some recordsets:
Code:
Dim rst As ADODB.Recordset
Set rst = New ADODB.Recordset
With rst
.CursorType = [blue]adOpenForwardOnly[/blue]
.CursorLocation = [blue]adUseClient[/blue]
.LockType = [blue]adLockReadOnly[/blue]
.Open strSQL, Cn
If .RecordCount > 0 Then
For i = 1 to .RecordCount[green]
'whatever I need to do[/green]
.MoveNext
Next i
End If
.Close
End With
Set rst = Nothing
Where strSQL is my Select statement(s).
For Insert, Delete, or Update I use:
Code:
Cn.Execute strSQL
Now, do I use all settings in [blue]BLUE[/blue] correct?
I think some Connection settings set also the recordset settings (is that right?) so maybe I don't need to do some of this (blue) stuff...?
Have fun.
---- Andy