vb select 查询 跪求高手(我菜鸟)

来源:百度知道 编辑:UC知道 时间:2024/09/20 20:37:23
我用vb adodc 和 access 中的biao1 链接,现在我要查询出 biao1中“商品名称”的字段所对应的值,条件是 “编号”=text1.text.
同时把查询出来的值填写到text3.text中

在你的程序的command1的按钮代码加个这个看看效果吧
Private Sub Command1_Click()
Adodc1.CommandType = adCmdText
Adodc1.RecordSource="select 商品名称 from biao1 where 编号='"+text1.text+"'"
Adodc1.Refresh
text3.text=adodc1.RecordSet!商品名称
end sub

**************
编号类型改成文本

"select 商品名称 from biao1 where 编号=" & text1.text

"select 商品名称 from biao1 where 编号='"+text1.text+"'"