ChefSausage
Programmer
I'm retrieving records from an Access database based criteria being passed from a search form, and in vs.net I'm getting the purple lines under the three form fields in my dynamic SQL string.
Const strSQL As String = "SELECT * FROM Client WHERE ClientName LIKE '%" & frmName.Text & "%' " & _
"AND ClientState LIKE '%" & frmState.Text & "%' AND ClientZip LIKE '%" & frmZip.Text & "%' " & _
"ORDER BY ClientName"
All other syntax is fine, but for frmName, frmState and frmZip, it's giving me a 'Constant expression is required' error. Why? I have it defined above in my .vb file with the 'Protected WithEvents....As System.Web.UI.WebControls.TextBox" and I have a previous template that uses a dynamic SQL string to update a table, yet doesn't give me this constant experssion issue. Ideas?
Const strSQL As String = "SELECT * FROM Client WHERE ClientName LIKE '%" & frmName.Text & "%' " & _
"AND ClientState LIKE '%" & frmState.Text & "%' AND ClientZip LIKE '%" & frmZip.Text & "%' " & _
"ORDER BY ClientName"
All other syntax is fine, but for frmName, frmState and frmZip, it's giving me a 'Constant expression is required' error. Why? I have it defined above in my .vb file with the 'Protected WithEvents....As System.Web.UI.WebControls.TextBox" and I have a previous template that uses a dynamic SQL string to update a table, yet doesn't give me this constant experssion issue. Ideas?