Okay. Information is crucial to us. Just downloaded your project. I saw the DBedits en DBCombobox is not having the datasource connected. Filled in the property datasource in the components. Now I link the datafield to a DBEdit. Now comes your problem: the IDE comes with the message : Unable to retrieve fields definition from dataset. It's crucial to tell that the IDE gives the message.
This is a normal reaction. When you want to select a datafield, the IDE will open the database to read the query. But you're putting your query on code in the FormCreate event. So there's no query yet and no datafields to select. But you can always put a datafield in the property Datafield.
Now (I think) a bug is coming. It seems that the DBComponents will get data information before the query is initialised. That's not correct. So I put the query into the property SQL of component SQLQuery.
Now the IDE still comes with the message, but running the project will give the right information.
The solution from paweld is correct, but it's a workaround. Normally you can fill in a datafield and the application should not crashing.
It so important to give all the information to help.
1) I did give all the info. Even provided a ZIp project
I said earlier that I got the "unable to retrieve.." error and couldn't add any fields to the SQLQuery.
2) I never said I was filtering the data with the DB controls. I said I just want to display the data in each cell into a DB control.
Someone else assumed I was filtering. I already figured that out, but it is not in the ZIP project. That can only be done through another SQL statement altogether.
So, the code supplied worked exactly as i was needing... to just display each field in a selected record.
And, as you point out, the components don't seem to work right. That is why I am thinking that I will have to rely on coding to do my CRUD and filtering.
I am all set for now. I haven't gotten to the "Create, Editt, Update, and Delete" of records yet.
My only first objective was reached... just display data in DB Controls.
Thanks