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
| Dim sql As String
Set cn = New ADODB.Connection
Set rspub = New ADODB.Recordset
Set colbndbiblio = New BindingCollection
cn.Provider = "msdatashape"
cn.Open "data provider = microsoft.jet.oledb.4.0;datasource=C:\Program Files\Microsoft Visual Studio\VB98\biblio.mdb"
sql = "shape {select * from publishers order by name} append ({select isbn,pubid,title,[year published],description,subject, notes from titles} as title relate pubid to pubid )"
rspub.Open sql, cn, adOpenDynamic, adLockOptimistic, adCmdText
With colbndbiblio
.Add textedit(0), "text", "pubid", , "id"
.Add textedit(1), "text", "name", , "nom"
.Add textedit(2), "text", "companyname", , "societe"
.Add textedit(3), "text", "address", , "adresse"
.Add textedit(4), "text", "city", , "localite"
.Add textedit(5), "text", "state", , "etat"
.Add textedit(6), "text", "telephone", , "telephone"
.Add textedit(7), "text", "fax", , "telecopie"
.Add textedit(8), "text", "zip", , "zip"
.Add textedit(9), "text", "comments", , "commentaires"
End With
Set dcpublishers.RowSource = rspub
dcpublishers.ListField = "name"
dcpublishers.MatchEntry = dblBasicMatching
dcpublishers = rspub!Name
Set DataGrid1.DataSource = rspub!Title.Value |
Partager