Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2016-02

Easy to use memory dataset and TMemDataset problems

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Aradeonas

Hi,

I want a memory dataset like VirtualTable [1]and really I cant understand what are these bufdataset and memdataset and wiki[2]?page as I cant make bufdataset works without a file. I want an easy to sue memory dataset without any file usage.

Yes there is a way to use?TMemDataset like this as @Thaddy said:

Show quoted text 8 lines
program memdbtest; {$apptype console}{$mode objfpc} uses? db,memds; var? ?MemDb:TMemDataset; begin?MemDb:=TMemDataset.Create(nil);?try MemDb.FieldDefs.Add('NAME',ftString,20);? ?MemDb.CreateTable; MemDb.Open;? ?MemDb.Append;? ?MemDb.FieldByName('NAME').Value:='Free'; MemDb.Post;? ?MemDb.Append; MemDb.FieldByName('NAME').Value:='Pascal';? ?MemDb.Post; MemDb.SaveToFile('MemDb.txt'); ?// as long you do not close, you don't have to save?finally? ?MemDb.Close;? ?MemDb.Free;?end; end.

But as you can see it use memds unit that CodeTools has?problem with memds unit and also it will replace it with MemDataSet unit that has a different TMemDataset without CreateTable option.

Also Wiki [3]says that?BufDataset is a better choice but is it really? and is it a choice for using as a memory dataset?how?

Regards, Ara

Links:

1. https://www.devart.com/vtable/
2. http://wiki.freepascal.org/How_to_write_in-memory_database_applications_in_Lazarus/FPC
3. http://wiki.freepascal.org/How_to_write_in-memory_database_applications_in_Lazarus/FPC#Introduction

http://www.fastmail.com - Same, same, but different... -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20160226/0f5f6b02/attachment.html>

Reply by email

Michael Van Canneyt
to Aradeonas
Aradeonas wrote 5 lines
Hi, I want a memory dataset like VirtualTable [1]and really I cant understand what are these bufdataset and memdataset and wiki[2]?page as I cant make bufdataset works without a file.

Why not ? It should perfectly work without file.

Michael.

Reply by email

Aradeonas
to Michael Van Canneyt
Why not ? It should perfectly work without file.

It seems I got a problem with changing properties in design time and then opening it. if I make everything in code it works good. But problem with memdatset and memds units still exist.

Regards, Ara

http://www.fastmail.com - Same, same, but different... -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20160226/0b9039cb/attachment.html>

Reply by email