Private Sub txtBuyerNum_KeyUp(KeyCode As Integer, Shift As Integer)
Dim strSQL As String
strSQL = "SELECT productID, articleNum AS 货号, buyerNum AS 客户货号, factoryNum AS 工厂货号, description AS 简要描述 FROM product"
strSQL = strSQL & " WHERE buyerNum LIKE '"
strSQL = strSQL & txtBuyerNum.Text & "%'"
strSQL = strSQL & " ORDER BY buyerNum"
itemListBox.RowSource = strSQL
itemListBox.Requery
End Sub
现在你知道为什么要dim strSQL as string了,否则,构造一个sql语句真的很长啊!作者: jerrysun 时间: 2009-8-10 22:03
不能直接使用sql语句吗?