-
SQL Satement error
I'm trying to run the following statement
Cmd = "SELECT * FROM Cabinets WHERE CabinetName = '" & txtServerCabinet.Text & "'"
DsAll1.Cabinets.Select(Cmd)
and im getting a missing operand after Cabinets error
Cabinets is the table, and im searching for the string in txtServerCabinet
then im trying to display the appropriate item in text boxes
any idea whats wrong?
db
-
"SELECT * FROM Cabinets WHERE (CabinetName = " & txtServerCabinet.Text & ")"
Are you trying to create a search box, to search your database for the input text?
-
I'm searching the db for the text located in the txtServerCabinet textbox.
-
Is the text being entered into txtServerCabinet limited, or can they enter anything they want? What I want to know is do you want your search to find only EXACT macthes, or any record similar to what they typed in?
If you're going to want EXACT matches only, you should change to a list/combo box, something that provides what they're options are. If not then you'll want to use a LIKE option with wildcards. If you want the latter, I'll post some code that should help.