I am new to VID and am confused on trying to make a parameterized query. I want to retrieve data that matches the name from a textbox. The recordset is working properly and is called rsITSxxx and it usess a SQL statement that is simply: select * from itsxxx. I also have a text box called tbNameSearch.
I tried this script:
Sub btnNameSearch_onclick()
oldSQL = rsITSxxx.getSQLText
newSQL = oldSQL & " where account_name = "
tbNameSearch.value
rsITSxxx.setSQLText(newSQL)
rsITSxxx.requery
End Sub
It doesn't work. What am I doing wrong? Is there a better way to do this?
Thanks
G
I tried this script:
Sub btnNameSearch_onclick()
oldSQL = rsITSxxx.getSQLText
newSQL = oldSQL & " where account_name = "
tbNameSearch.value
rsITSxxx.setSQLText(newSQL)
rsITSxxx.requery
End Sub
It doesn't work. What am I doing wrong? Is there a better way to do this?
Thanks
G