sqlite3 access violation lazarus / 16-Databases ---------------------------------------------------------------------- davesimplewear · 2010-09-27 23:05 as I have noted previously, I am trying to get cascading master detail to work, made a test program and could not duplicate the error with the test db, so went back to the main program and it still doesn't want to work, so switched databases to the production one and now the test program comes up with an access violation. I have posted the test program for perusal, if someone could help it would be great, probably something simple that I just can't see at the moment. Regards Dave ---------------------------------------------------------------------- LuizAmérico · 2010-09-28 01:56 Set the mastersource propertie after opening the datasets:   fName := ExtractFilePath(Application.ExeName) +'fleet.db3'; for n := 0 to ComponentCount -1 do     begin      c := Components[n];      if c is TSqlite3Dataset then      TSqlite3Dataset(c).FileName:= fName;     end;  for n := 0 to ComponentCount -1 do     begin      c := Components[n];      if c is TSqlite3Dataset then      TSqlite3Dataset(c).Open;     end;   Man.MasterSource := dsComp;   ManList.MasterSource := dsMan; ---------------------------------------------------------------------- davesimplewear · 2010-09-28 05:35 Thank you Luiz, did you try the test as modified by yourself, as I get a Sql Error on the man table near "where":, I assume it is the sql statement when starting, it used to display the sql statement in the sqlite3 table component, now it doesn't show anywhere, so the onl way I can see to alter it would to be to declare it in the opening algorithim. Regards Dave ---------------------------------------------------------------------- LuizAmérico · 2010-09-28 13:51 Leave the Sql property in Object Inspector empty (''). The test program is working here with the modifications i sent. ---------------------------------------------------------------------- davesimplewear · 2010-09-28 22:12 Thank you for your reply Luiz, the sql prpoerty in the object inspector is always empty even after opening the table, as I was saying in the last post and I still get the sqlite error. Regards Dave ---------------------------------------------------------------------- zeljko · 2010-09-29 11:13 I've run into such problem with sqlite few days ago and found why it raises av. 1.You have more than one libsqlite3.so around, eg. I've found on my fedora 13 that xulrunner have it's own libsqlite3.so and when our loader does dlsym() it points to xulrunner libsqlite3 in memory which refuses to read that address (seen via gdb). Solution: remove extra libsqlite3.so real files and make symlink to /usr/lib/libsqlite3.so.0.86.XX. Now it works as excepted.Note that same error raised using ZEOS sqlite or fpc sqlite (both uses dynamic loading). ---------------------------------------------------------------------- davesimplewear · 2010-09-29 12:18 Thanks Zelko, I use sqlite quite a bit and this current project is the only where I have had this problem. I will test out your suggestion anyway and see if it works. Regards dave ---------------------------------------------------------------------- zeljko · 2010-09-29 13:34 As I said it depends on machine installation.If you have multiple libsqlite around which are loaded by some apps then you have problem.Only solution I've found is to delete all other libsqlite3.so except one from /usr/lib , and make symlinks to deleted ones. ---------------------------------------------------------------------- LuizAmérico · 2010-09-29 23:15 The test program modified does not work for you? It works here. ---------------------------------------------------------------------- davesimplewear · 2010-09-30 01:08 No Luiz, as isaid earlier it comes up with a sqlite error on the man table near "where", Iassume that the sql statement selecting the table is still held somewhere but is not visible in the  object inspector, there are no sql statements visible in any sqlite3 tables anymore, is that normal, as I used to see them before. Regards Dave