You have to set the SQLQuery in code somewhere. Properties can't contain
references to other properties.
Put this in the Action Event of the Button, before you run the query:
DatabaseQuery1.SQLQuery="Select * from dvd where title
='"+titleField.text+"'"
HTH,
-Mike
on 2/26/02 8:58 PM, Danandjulies at aol dot com at Danandjulies at aol dot com
wrote:
> OK, here's my delima. I've got an application that I use to maintain an
> inventory of my dvds. cds etc... I've got the db thing working great and I've
> got a listbox that will display all the info in the db. My problem is, I want
> to be able to search for a dvd by entering the title in an editfield. I want
> the search to be accomplished with a pushbutton. I've got the databasequery
> bound to the listbox, but I can't get the sqlselect from where to work. It's
> either not working, or my listbox isn't displaying the info. heres the query
>
> Select * from dvd where title ='titleField.text'
>
> the action event for the pushbutton is
>
> databasequery1.runQuery
>
> The binding for the databasequery to the list box is
>
> bind listbox1 with list data from databaseQuery1 results
>
> is there something that I'm missing?
>
> Is it possible to to use the editfield this way, or do I have to convert the
> text from the editfield to something else before the databasequery can use it
> in a search?
>
> Thanks
> Dan
|