ActiveX Data Object Database (ADODB) Using the Biblio Database
Stuff to Download Into the SAME Directory --
Refresh Code --
Private Sub Command1_Click()
Dim sql As String
sql = "select * from authors"
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = sql
Adodc1.Refresh
Set DataGrid1.DataSource = Adodc1
Find Code --
Private Sub Command2_Click()
Dim sql As String
sql = "select * from authors where author like '" & Text4.Text & "%'"
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = sql
Adodc1.Refresh
Set DataGrid1.DataSource = Adodc1
End Sub
Initialization Code (Form_Load) --
Private Sub Form_Load()
Dim sql As String
sql = "select * from authors where author like 'Smith%'"
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = sql
Adodc1.Refresh
Set DataGrid1.DataSource = Adodc1
End Sub
Last edited by DrB on 5-15-2001