Subject Re: [IBO] TIBOQuery & kbmMemTable: access violation
Author Lester Caine
> kbmMemTable is a popular memory table, that can be freely downloaded
> from http://www.components4developers.com .
>
> kbmMemTable should work with all Tdataset descendants.

Use it ina few places myself without any problem.

> Unfortunately I get an access violation _the 2nd time_ I use the
> following, minimal code:
>
> procedure TMaiFrm.test1Click(Sender: TObject);
> begin
> with Query1 do // Query1 is a TIBOQuery
> begin
> DatabaseName:='cb4db';
> Close;
> SQL.Clear;
> SQL.Add('select * from tb_per');
> Open;
> end;
>
> kbmMemTable1.EmptyTable;
> kbmMemTable1.LoadFromDataSet(Query1,[mtcpoStructure]);
> end;

Not sure that I like the 'flow' of this. The first time you
call it, nothing is open. The second time you are trying to
change the DatabaseName while the Query1 is open - even
though the name is the same. Don't think this is anything to
do with kbmMemTable. Try commenting out those lines and I
think you will have the same problem. Close the query first.

Having said that, I can't see the point of trying to buffer
a buffered dataset by copying it to an in memory table. What
are you trying to achieve?

I only use kbmMemTable to store data copied from the query,
which is then closed, and the network connection is dropped,
so I have not used LoadFromDataSet - prefering a local
'hardcoded' setup for kbmMemTable.

--
Lester Caine
-----------------------------
L.S.Caine Electronic Services