Page 1 of 1

"SQL Error: library routine called out of sequence"

Posted: 11.02.2011, 03:34
by seaton
After a few days of newbie head scratching some deployment problems with a lazarus built zeoslib + sqlite applicatiton. I thought I'd post here for anyone else that comes across a similar problem and should save them some head scratching in the future

Without reinventing the wheel here is the original thread I posted on the Lazarus forum [link=] http://www.lazarus.freepascal.org/index ... 072.0.html[/link]

If you get this error when you deploy your application on a PC other than the development machine, yet you don't receive it on your development machine you have your TZConnection connected at design time in the form builder, however the application is still looking for your development database file at run time.

In my case I had a TZConnection connected at design time with a link to my development database. All my database components live in a datamodule which is the first form to be created, this modules 'onCreate' method sets the applications database file location based on the install location and then connects to the database.

Because this component was enabled/connected at design time so I can see a live view of data in my form designer, it was also enabled at runtime before the onCreate method can set the new connection parameters, so on the development machine it can find the development database, connect to this, but gets changed to the new database lcoation and connects then connects, no error.

However on deployment no development database exists and the component tries to connect, bang the above exception is generated before the datamodule onCreate has a chance to setup the component.

Hope this helps,

Stephen...