Doesn't happen here. Manjaro Linux 64-bit, lazarus trunk qt interface, fpc trunk. Try to convince us with something reproducible.
I'm not sure, but it happened here for many years. I installed OS and Lazarus-FPC for many many times, and it always happened consistently.
To start new project, I copied from another stable project, add something and also remove any unneeded units.
I do Remove from Project and select any unused units. no error message here. but if I do it (Remove from Project) again these units still remain. only one unit (the last selected) removed, but other selected unit not removed. I face this issue since the first time I use Lazarus, and remain until now.
- Doesn't happen here, I can perfectly connect to my local MySQL (after dropping TSQLTransaction and set it everywhere required) and displays whatever value I choose from my query result
- SQLdb ALWAYS requires transaction, please read SQLdb tutorial and reference in the wiki
- Even without transaction, setting TSQLQuery.Active to true in object inspector will result in "transaction not set" but that's it, no other errors, no crash whatsoever
I see, but it's not about connecting and/or fetching data from database, I do connection and getting data at run time, even database (some times) also created at run time (and everything ok). It's about setting property (especially DataField) at desing time, and it only occurs on 1.4 and trunk (with different message), It not happen on 1.2.
And thanks to Lazarus-FPC teams, I got millions of something from commercial database projects using FPC-Lazarus (SQLDB as data connection).
Try this:
1. put SQLQuery1, leave Database and SQL blank.
2. Datasource1, set Dataset=SQLQuery1
3. DBEdit1, set DataSource=DataSource1, Fill or select DataField on ObjectInspector ==> AccessViolatio (1.4) or "Unable to retrieve fields definition from dataset" (trunk). This sould not prompt these message, very disturbing, becouse we can fill it using directinput, so list of fields should be as reference, not constraint. so ignore whatever user fill if some requirement not set. Dont we can assign thus all required property at run time?
The annoying message not showing only if :
- put dbconnection and set all required (databasename, host, user, password etc)
- put sqltransaction and set database to dataconnection
- put sqlquery, set database to dataconnection AND FILL SQL STATEMENT (if sql blank the message still arise).
- put datasource, set dataset to sqlquery
- DBEdit1, set DataSource=DataSource1, Fill or select DataField. everything ok
(About SQL statement, if we fill first, and do until the last step (setting Datafield succesfully) and then remove sql statement on sqlquery, error message dissappears. strange behavior.)
OR (message not show)
Fill list of fields of dataset using Edit Fields... (right click sqlquery /doubleclick), then create new field (or press Ins on keyboard)
Conclusion:
This message not happen only when we set all required component/property, or we create list of fields manually.
Why....? One more time, don't we can fill all of thats at run time? I think this not reasonable behavior.
For now, I am overriding TDataFieldProperty editor using my CustomeDataFieldProperty editor.
Please fallback this behavior like on 1.2.
Regards.