Tuesday, December 06, 2005

Day 1 - First issues

- DB Express has a TStringList named Params; all databases use it, so to access PostgreSQL (the DB I use) there were a line DriverName := 'PostgreSQL'. Using SqlDB, I used the TPQConnection component, and the parameters are now properties.

- My OPF has an option to trim the strings it gets from (or write to) the DB. It used Trim(X) where X is a Variant. FPC did not like that, and I had to change it to Trim(VarToStr(X)). There's hundreds of files that use that construct in my project, but thanks God it's all code that is automagically generated by a custom made tool.

- Bug 4323: the workaround was use ShortDateFormat and others instead of the thread safe TFormatSettings.

- Transactions: Instead of TTransactionDesc, there is TSQLTransaction. It led to a lot of changes, including this one that I'm afraid is not a good one (the condition seems to be different):
if Transaction.Active {FdscTrans.InTransaction} then ...
My OPF controls the transactions, throwing its own errors when you try to start a transaction when there's one started, or try to commit when there's no transaction. Is the TSQLTransaction is always active when the connection is open?

- A weird thing was an error using the LIMIT clause of some SQL queries. I removed them by now, but these LIMIT clauses are needed for the correct operation of the OPF. I will get back to this later.

That's it. Also, there was a lot of strange behaviours of the IDE (remember I'm using Windows XP), but nothing that can be considered a showstopper. It includes wrong syntax highlight, some weird things with Ctrl-Space and ghost carets. Are these known bugs?

1 comment:

Anonymous said...

I put a link to your log on the Lazarus wiki.