1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| Private Sub Form_Load()
Dim SQL As String
Set cn = New ADODB.Connection
Set rsPub = New ADODB.Recordset
Set BndPublishers = New BindingCollection
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\DidactDB\Biblio2000.mdb"
SQL = "SELECT Publishers.* From Publishers WHERE City ='New York'"
rsPub.CursorLocation = adUseClient
rsPub.Open SQL, cn, adOpenDynamic, adLockOptimistic, adCmdText
rsPub.MoveFirst
Set BndPublishers.DataSource = rsPub
'Ajoute à la collection Bindings.
With BndPublishers
.Add txtPubID, "Text", "PubID", , "ID"
.Add txtName, "Text", "Name", , "Nom"
.Add txtCity, "Text", "City", , "Localité"
End With
End Sub |
Partager