moving dbase components to another form lazarus / 16-Databases ---------------------------------------------------------------------- erkka · 2010-09-14 07:13 Well, I got my database stuff working pretty well. Then I found out that it would be better to have all of the database- enginery on another form in the same application. So I created an another form and happily copy-pasted all the necessary components and related code into the another form. It compiles fine, but when I run it, I get "sigsegv" in  ODBCLaskut.Connected:=false; any idea what did I miss when copy-pasting the components? ---------------------------------------------------------------------- JD · 2010-09-14 07:29 If I understand you, you want to create a data module. It would be best if you send a small test project so we can better understand what went wrong. I remember that I've gotten the same error message when I used DBEdits on a form with datafield & datasource specified but the connection component was not active (or was false). Changing the connection property to true solved the problem but I don't know it that is the same problem you have. Cheers, JD ---------------------------------------------------------------------- erkka · 2010-09-14 07:53 Hey, thank you for you help & engouragement! Maybe it was just an issue in which order forms are created and activated and so. Instead of calling Form2.InitializeDatabases from Form1.FormCreate, I call it from Form2.FormCreate, and just to be sure added this: Code: [Select]  SQLTransaction1.Active:=true;   SQLTransaction2.Active:=true; Seems to work now. But, one simple question though - does that mean that my databases are initialized every time Form2.Visible is set true? Or does it run FormCreate only once, when the form is initially created?  (oh, it is already ten years since I was last time coding with some old version of Delphi, and how have I forgot the basics... well anyway, thank you for guiding us newbies ---------------------------------------------------------------------- JD · 2010-09-14 10:05 Quote from: erkka on September 14, 2010, 09:53:01 amHey, thank you for you help & engouragement! Maybe it was just an issue in which order forms are created and activated and so. Instead of calling Form2.InitializeDatabases from Form1.FormCreate, I call it from Form2.FormCreate, and just to be sure added this: Code: [Select]  SQLTransaction1.Active:=true;   SQLTransaction2.Active:=true; Seems to work now. But, one simple question though - does that mean that my databases are initialized every time Form2.Visible is set true? Or does it run FormCreate only once, when the form is initially created?  (oh, it is already ten years since I was last time coding with some old version of Delphi, and how have I forgot the basics... well anyway, thank you for guiding us newbies Your databases are ready for data access & retrieval wherever you have the put the following Code: [Select]  SQLTransaction1.Active:=true;   SQLTransaction2.Active:=true; in your code. Setting the SQLQuery property to True will perform the actual data retrieval.