将strQuery="select * from customers,orders where & _
"customers.客户号)=orders.客户号 & _
"and customers.客户号=" & dcborderno.boundtext
改为
:
strQuery="select * from customers,orders where customers.客户号=orders.客户号 and customers.客户号= &'" dcborderno.boundtext "'&"
"customers.客户号)=orders.客户号 & _
"and customers.客户号=" & dcborderno.boundtext
改为
:
strQuery="select * from customers,orders where customers.客户号=orders.客户号 and customers.客户号= &'" dcborderno.boundtext "'&"
应该是
strQuery="select * from customers,orders where customers.客户号=orders.客户号 and customers.客户号= '"& dcborderno.boundtext &"'"
" customers.客户号 = orders.客户号 " & _
"and customers.客户号= " & dcborderno.boundtext 注意引号和括号的位置!!另外,如果 .客户号 是定义的 vbtext 类型,在sql语句里要在字段两边加单引号!
完全正确