1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
Private Sub Form_Load()
Dim Cnn1 As ADODB.Connection, Cmd1 As ADODB.Command, MonRs As ADODB.Recordset
Set Cnn1 = New ADODB.Connection
With Cnn1
.Provider = "Microsoft.Jet.OLEDB.4.0;"
.ConnectionTimeout = 30
.Mode = adModeShareExclusive
.Open "Data Source=P:\Projet\Liaison_oracle.mdb ;User Id=azeaeaze; Password=azeaeaze"
End With
'par Connection.Execute
'Set MonRs = Cnn1.Execute("SELECT INDLIG1 From G_INDIVIDU where nom ='MARTINOT'", , adCmdText)
'MonRs.Close
'par command.execute
'Set Cmd1 = New ADODB.Command
'With Cmd1
' .ActiveConnection = Cnn1
' .CommandType = adCmdText
' .CommandText = "SELECT INDLIG1 From G_INDIVIDU where nom ='MARTINOT'"
'End With
'Set MonRs = Cmd1.Execute
'MonRs.Close
'par recordset.open
Set MonRs = New ADODB.Recordset
MonRs.Open "SELECT INDLIG1 From G_INDIVIDU where nom ='MARTINOT'", Cnn1, , , adCmdText
End Sub |
Partager