先在工程中引用 microsoft..........object2.5 library
Dim cnn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Private Sub Form_Load()
cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\Info.mdb;Persist Security Info=False"
rs.Open "select * from Info where 国名='中国'", cnn, adOpenKeyset, adLockOptimistic, -1
Set Text1.DataSource = rs
Text1.DataField = "国名"
End Sub
首先数据库连接
第二去数据库查询select 国名 from info where 国名="中国"
把查找将恶果填充textbox