很简单,传参啊
看以下代码
If Text1.Text = "" Then Text1.Text = "%"
If Text2.Text = "" Then Text2.Text = "%"
If Text3.Text = "" Then Text3.Text = "%"
If Text4.Text = "" Then Text4.Text = "%"
If Text5.Text = "" Then Text5.Text = "%"'传参
DataEnvironment1.Command2 Text1.Text, Text2.Text, Text3.Text, Text4.Text,Text5.Textdatareport2.show在数据环境下写入sql语句
 select * from qq.custom_tab where cusnum like ? and areazhangno like ? and phone like ? and shzhangno like ? and wangno like ?