Datamodule, what are they for? are they working? lazarus / 16-Databases ---------------------------------------------------------------------- gypsymauro · 2009-11-19 15:31 I created a new project , I added a new datamodule and then on it I created a new postgresql connection, a transaction a datasource and a tquery object, I connected them then I wrote a sql statement select field1 from table, I run the query with the green button available when the query object is connected to the db and it works, and it displays data.. but when I try to add fields it says me "it was not possible to get the dataset field's list check dataset settings, access violation" then I create the same object on a form and everything goes right.. so are the Datamodule broken? I tried this on linux with 0.9.26 and 0.9.28 I hope there is a solution cause Datamodule are so usefull to keep ordered things tank you Mauro ---------------------------------------------------------------------- a.atalla · 2010-06-12 01:59 i have similar problem here with lazarus 0.9.19 fromsvn  fpc2.4 i use datamodule contains sqlite3dataset and a datasource when i try executing the following code in the main unit i get the Access violation error Code: [Select]procedure TfrmMain.FormCreate(Sender: TObject); begin      DM.Sqlite3Dataset1.FileName:='st4.db';      DM.Sqlite3Dataset1.TableName:='equipment';      DM.Sqlite3Dataset1.Open; end; ---------------------------------------------------------------------- bflm · 2010-06-12 05:39 Quote from: a.atalla on June 12, 2010, 03:59:05 ami have similar problem here with lazarus 0.9.19 fromsvn  fpc2.4 i use datamodule contains sqlite3dataset and a datasource when i try executing the following code in the main unit i get the Access violation error Code: [Select]procedure TfrmMain.FormCreate(Sender: TObject); begin      DM.Sqlite3Dataset1.FileName:='st4.db';      DM.Sqlite3Dataset1.TableName:='equipment';      DM.Sqlite3Dataset1.Open; end;    Was a valid, non nil value ever assigned to 'DM' at the time 'TfrmMain.FormCreate' gets invoked? Can't figure out that from the snippet alone... ---------------------------------------------------------------------- davesimplewear · 2010-06-12 16:59 also in the project form create is the datamodule the first form created? This will result in an error if not. Regards Dave