加入combox控件:combo1.clear while not rs.eof combo1.addItem rs!name rs.movenext wend选择combox的内容,查询相应信息: sql="select word from youtable where [name]='"& combo1.text &"'" 其它如上
选择combox的内容,查询相应信息: sql="select word from youtable where [name]='"& combo1.text &"'" 其它如上前面好了 最后这里 怎么在输出到text控件里面呢 这样就用不到 MSHFlexGrid控件了吧
Dim rs As ADODB.Recordset
Dim sql As String
Set cn = New ADODB.Connection
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0; " _
& "Data Source=" & App.Path & "\db1.mdb;Persist " _
& "Security Info=False;Jet OLEDB:Database Password=123" sql = "SELECT [name] FROM youTable"
Set rs = New ADODB.Recordset
rs.Open Sql, cn, _
adOpenKeyset, adLockOptimistic Set fg.DataSource = rs'fg是MSHFlexGrid控件的名称,用来显示数据
while not rs.eof
combo1.addItem rs!name
rs.movenext
wend选择combox的内容,查询相应信息:
sql="select word from youtable where [name]='"& combo1.text &"'"
其它如上
sql="select word from youtable where [name]='"& combo1.text &"'"
其它如上前面好了 最后这里 怎么在输出到text控件里面呢 这样就用不到 MSHFlexGrid控件了吧