在vb6.0中在一条select语句时候能多次用到like吗? 多次模糊查询
PrivateSubCommand4_Click()Dimsql3AsStringDimsql4AsStringSetconn=NewADODB.Connectionco...
Private Sub Command4_Click()Dim sql3 As StringDim sql4 As String Set conn = New ADODB.Connection conn.ConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=ucacess;Data Source=FDD3D52D4BEC45B"conn.Open Set RS = New ADODB.Recordset RS.ActiveConnection = conn sql3 = "select count(*) from test where Click like '%" & Combo6 & "%'" RS.CursorLocation = adUseClient RS.Open sql3, conn Set DataGrid1.DataSource = RS DataGrid1.Refresh End Sub我想在前台combo控件中选择的数据表现到这句sql语句中。以下的这句能实现吗?sql3 = "select count(*) from test where Click like '%" & Combo6 & "%'" AND Click like '%" & Combo5 & "%'" AND Click like '%" & Combo4 & "%'" 如果不能实现我该怎么该?谢谢帮助
展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询