Hi Kim,
Given your comment above, I suspect I am not using kbmmemtable correctly. 🙁
In my datamodule (dmQ) I have the Database Tables, including the Company Table, it is an ElevateDB database, and only a kbmmemtable component (mtCompany), no stream format component.
In dmQ I have the following code..
{code}
Company.Open;
//
mtCompany.LoadFromDataSet(Company, [mtcpoOnlyActiveFields, mtcpoProperties, mtcpoFieldIndex, mtcpoDontDisableIndexes, mtcpoIgnoreErrors]);
//
Company.Close;
{code}
The fields are pre defined in mtCompany at design time.
I don’t have a StreamFormat component. I am not loading from any .bin or .csv file..
Ian
Thanks Kim,
I have settled for using the field variables directly, defining them at design time.
The kbmmemtable component is in a Datamodule called dmQ.
Using the field variables directly in the datamodule works fine.
What doesn’t work is trying to access the field variables from the Main form..
i.e. sQuoteReportName := Trim(dmQ.mtCompanyCompanyInit.AsString)
Even though all the fields have been loaded into mtCompany at design time.
Am I missing some nuance??
Regards & TIA,
Ian
OK. I thought I had it sorted.. 🙁
It all looks OK in the Datamodule (dmQ) where the above code is located.
But, in the mainform code it doesn’t like code like the following..
” sQuoteReportName := Trim(dmQ.mtCompanyCompanyInit.AsString) + ‘General Quote’;”
I have to make it..
“sQuoteReportName := Trim(dmQ.mtCompany.FieldByName(‘CompanyInit’).AsString) + ‘General Quote’;”
defeating the purpose. 🙁
Am I doing something wrong??
Regards & TIA,
Ian
Hi Kim,
You did answer my question, I just didn’t read it right. 🙁
So, If the fields are predefined and I have this..
{code}
…
//
Open;
//
mtCompany.LoadFromDataSet(Company, [mtcpoStructure, mtcpoOnlyActiveFields, mtcpoProperties, mtcpoFieldIndex, mtcpoDontDisableIndexes, mtcpoIgnoreErrors]);
//
Close;
//
end;
//
mtCompany.Open;
//
CurrentEurekaLogOptions.SendSMTPClientHost := mtCompanySMTPServer.AsString;
CurrentEurekaLogOptions.SendSMTPClientPort := mtCompanySMTPPort.AsInteger;
…
{code}
If I make “AutoUpdateFieldVariables” True then it fails at “CurrentEurekaLogOptions.SendSMTPClientHost := mtCompanySMTPServer.AsString;”
If I remove “mtcpoStructure” with “AutoUpdateFieldVariables”, it works fine.
If I remove “mtcpoStructure” with “AutoUpdateFieldVariables” False, it also works fine.
What did you expect “AutoUpdateFieldVariables” to do?
Regards & Tks,
Ian
Tks Kim.
If the loaded structure/definitions are exactly the same as the pre-defined fields, will that still invalidate?
Ian