资 源 简 介
VB 6.0 按字段显示Access数据库所有值,是一个按条件查询数据库的例子,这里的数据库为BOOK2.mdb,核心的代码如下:
Private Sub Adodc1_WillMove(ByVal adReason As ADODB.EventReasonEnum, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)
End Sub
Private Sub Form_Load()
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "ook2.mdb;Persist Security Info=False "
Adodc1.RecordSource = "select * from 作者"
Set DataCombo1.DataSource = Adodc1
DataCombo1.DataField = "城市"
Set DataCombo1.RowSource = Adodc1
DataCombo1.ListField = "姓名"
End Sub