Himie
Members-
Content Count
6 -
Joined
-
Last visited
Everything posted by Himie
-
Hi There I am using (or trying to use) FDMemTables and it is not cooperating. I am using the Community edition of Delphi 10.3 with Windows 10. I have a DataModule in which I have placed the respective FDMemTables and in the OnCreate event I have put the Field Definitions and create the table as below: with fdmAdmin.FieldDefs do begin // fdmAdmin clear; Add('ID',ftString,4); Add('Num',ftString,4); Add('SaveLocation',ftString,80); Add('LastPurchOrder',ftString,30); Add('LastInvoice',ftString,30); Add('LastReceipt',ftString,30); Add('CurrentJournal',ftString,30); end; fdmAdmin.CreateDataSet; In another Unit (which references the DataModule1 in its Implementation Uses) if have the following code: DataModule1.fdmAdmin.Active := true; if DataModule1.fdmAdmin.RecordCount < 1 then begin // if no records means starting and no saving previously done DataModule1.fdmAdmin.Append; DataModule1.fdmAdmin.Edit; DataModule1.fdmAdmin['LastInvoice'] := '0000'; DataModule1.fdmAdmin['LastPurchOrder'] := '0000'; DataModule1.fdmAdmin['LastReceipt'] := '0000'; DataModule1.fdmAdmin.Post; end; I get the message 'Cannot open dataset [TFDMemTable]. A DataTable or a DataView must be supplied. Hint: if this is a TFDMemTable, use CreateDataSet or CloneCursor to open dataset.' There is a CreateDataSet in the DataModule1 code. Anyone point me in the right direction here? Thanks heaps. Himie
-
Hi Carlos Thank you for your response. I'm no Delphi Guru either, just plug away and spend a lot of time trying to get it to work. I have worked around the issue it seems that something was not working properly with the DataModule part of the program where it was not going right through the code section of that module. I spent weeks endeavouring to get it to work and finally had to put all the FDMemTables onto a form and use the code section of the form to define and create the tables (instead of using the DataModule). It then worked fine. Cheers Himie
-
Members 0 2 posts Report post Posted 3 hours agoHi There Hi There (Reposting here as think might reflect more on databases than datasets where posted previously) I am using (or trying to use) FDMemTables and it is not cooperating. I am using the Community edition of Delphi 10.3 with Windows 10. I have a DataModule in which I have placed the respective FDMemTables and in the OnCreate event I have put the Field Definitions and create the table as below: with fdmAdmin.FieldDefs do begin // fdmAdmin clear; Add('ID',ftString,4); Add('Num',ftString,4); Add('SaveLocation',ftString,80); Add('LastPurchOrder',ftString,30); Add('LastInvoice',ftString,30); Add('LastReceipt',ftString,30); Add('CurrentJournal',ftString,30); end; fdmAdmin.CreateDataSet; In another Unit (which references the DataModule1 in its Implementation Uses) I have the following code: DataModule1.fdmAdmin.Active := true; if DataModule1.fdmAdmin.RecordCount < 1 then begin // if no records means starting and no saving previously done DataModule1.fdmAdmin.Append; DataModule1.fdmAdmin.Edit; DataModule1.fdmAdmin['LastInvoice'] := '0000'; DataModule1.fdmAdmin['LastPurchOrder'] := '0000'; DataModule1.fdmAdmin['LastReceipt'] := '0000'; DataModule1.fdmAdmin.Post; end; I get the message 'Cannot open dataset [TFDMemTable]. A DataTable or a DataView must be supplied. Hint: if this is a TFDMemTable, use CreateDataSet or CloneCursor to open dataset.' There is a CreateDataSet in the DataModule1 code. Anyone point me in the right direction here? Thanks heaps. Himie
-
Thanks I hvae the DataModule1 in the auto-create forms part so should execute. Will investigate this further. Thanks for the tip. Himie
-
Hi Ralf No, I have not referenced the CachedUpdates at all Cheers Himie
-
Hi Folks I have been using Delphi for quite some time but have just started trying to use ClientDataSets to utilize their nested data. I have been attempting for some days now to make these work according to the books and articles I have downloaded but it will just not work. Your suggestions are most sought. I put a ClientDataSet (called cdsJournal) on my DataModule, a DataSource (called dsJournal) and a DataSetProvider (called dspJournal). I endeavor to link them putting in the DataSet in the dspJournal as cdsJournal, the DataSet of the DataSource as cdsJournal, and the Filename of the cdsJournal set to D:\Mens Shed Accounting\Journal\2020-21_07_January. It has an error for the ClientDataSet with 'no ProviderName'. If I put this in (which is dspJournal) I get an error 'No circular references allowed' (obviously the cdsJournal referencing the dspJournal and the dspJournal referencing the cdsJournal). If I remove the DataSet reference (cdsJournal) from the dspJournal I get the error 'No DataSet'. Accoriding to the books it should work even without a DataSetProvider but other books say that a ClientDataSet does not have this built in. I just don't know where to go. I have the book Delphi in Depth: ClientDataSets by Cary Jensen and a number of other books which I have tried to follow meticulasly but to no avail. Thank you in advance. I am using Community Edition of Delphi 10.4. Ross