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
|
private sub form_load()
connect
put_record ("select * from client")
Set DataGrid1.DataSource = rst
put_record ("select nom from matière")
DBCombo1.?????
end sub
Private Sub connect()
Set cnx = New ADODB.Connection
'définition du pilote de connexion
cnx.Provider = "Microsoft.Jet.OLEDB.3.51"
cnx.ConnectionString = Application.DatPath & "\plug_ins\devis\data\bd197.mdb"
cnx.Open
End Sub
Private Sub put_record(request As String)
Set rst = New ADODB.Recordset
rst.CursorLocation = adUseClient
rst.CursorType = adOpenKeyset
rst.LockType = adLockOptimistic
rst.ActiveConnection = cnx
rst.properties("IrowsetIdentity") = True
rst.Open request, , , , adCmdText
End Sub |
Partager