VB2005字串中包含子串函数求教
ACCESS数据表rsb中有一字段名为xm,想通过以下语句:
xm1 = Trim(TextBox1.Text)
SQLString = "SELECT xm,xb From rsb WHERE 条件 ORDER BY dzh ASC"
在VB2005中想向TextBox1控件中输入字符串,通过SQLString语句将数据表rsb中xm字段里包含TextBox1中字符串的所有记录都找出来,应该使用什么函数?SQLString语句中的"WHERE 条件"应该怎么写?请各位指教.多谢.
[解决办法]
SQLString = "SELECT xm,xb From rsb WHERE xm like('" & xm1 & "%')ORDER BY dzh ASC"
[解决办法]
SQLString = "SELECT xm,xb From rsb WHERE xm like '%" & xm1 & "%' ORDER BY dzh ASC"