Archive for July 19th, 2009
db component chain
If you want to connect visual components like grids or editboxes to a dataset, you’d expect things to be a bit straightforward, like for example:
DBGrid -> DataSource -> SQLQuery -> DBConnection
Unfortunately, when it comes to db components, this chain will result in a “Operation not allowed on a unidirectional dataset” error. Which would make a tiny bit of sense if you want to make the Grid editable, but even when you switch off every possible property off to edit the grid, the error will still come up.
If you’re like me, you’d probably just put a StringGrid on your form and loop over the SQLQuery to show all the data. That does however take a lot more writing code for something that should be quite easy to do.
Aparantly, this is the way to do chain the components to be able to link your things together:

Add comment July 19, 2009