Hey there, I have a couple of issues regarding TBufDataset and TField.
I am developing a software that works with SQLite3 database. Insertion and selection works independently - data is saved by one module and read by another. Thus, it would really help to have a dataset working "offline" (and it was my understanding TBufDataset works this way).
Currently, I have a TSQLite3Dataset object select the data, then clone the whole dataset (FieldDefs and Records) to TBufDataset. Now here's the first issue:
No matter what, I can't seem to store VARCHAR columns as ftString instead of ftMemo (TFieldType). Each VARCHAR column is automaticly stored as ftMemo, and I can't seem to find a workaround. And if I change those fielddefs to ftString on my own and assign a string, its left empty. Now, I could live with ftMemo, since through OnGetText I would format it properly, BUT, ftMemo cannot be set as Index.
Which brings me to second issue. How does filtering TBufDataset work? I thought it was going to be easy, just a few lines of code, but nothing seems to work.
bufDs.Close;
bufDs.Filtered := True;
bufDs.Open;
Deletes the whole data (0 records after opening).
bufDs.Open;
bufDs.Filtered := True;
Deos nothing, even though filtering condition has changed.
Right now I am trying to filter through OnFilterRecord event, since I can't use bufDs.Filter := 'column = ''expr''';
as column is not an index field. And when I tried to add it as an index, I got an error stating that ftMemo field cannot be set as index.
So here comes the third and final issue:
How to set field to ftString and get it work properly?
I cannot include more code as I am at Uni right now, but I'll attach if needed once I get home in a couple of hours.
Thank you in advance for ANY kind of advice or help.