I have a form, textbox, data control, a DBGrid control, and a command button. I have the data control connected to a DBASE table, the DBGrid is connected with the data control to display the table in the grid. I am trying to type the SQL statement into the textbox, then I press a button to query the table. This isn't working
My table name is MyTable.DBF
here is my statement
This go's into the textbox
Button Code is
Data1.RecordSource = Text1.text
When I press my button, VB gets confused. It doesn't understand.
Here is the message box I get....
Run-Time Error 3125
The database engine can't find "SELECT FirstName FROM MyTable"
Make sure it is a valid parameter or alias name, that it doesn't include invalid character or punctuation and that the name isn't too long.
I have tried quotes around the SQL statement but doesn't work either...
Please someone help.