Recent

Author Topic: Linux 64 and memory resident database  (Read 4452 times)

liewald

  • Full Member
  • ***
  • Posts: 144
Linux 64 and memory resident database
« on: January 19, 2011, 10:50:52 am »
I'm having real problems getting a memory resident database with a locate on it to work on a suse 64bit linux machine

TBufdatset leaps off to some unknown place in memory and the stored data returns as garbage ( See my last post )
sqllite3 wont install and crashes the lazarus build
rxmemorydata just doesn't work

anyone got any ideas?

 %)

« Last Edit: January 19, 2011, 10:52:44 am by liewald »

liewald

  • Full Member
  • ***
  • Posts: 144
Re: Linux 64 and memory resident database
« Reply #1 on: January 19, 2011, 12:12:23 pm »
Help

I've changed the code to use a memdataset and there are still problems

when I define the table in the IDE it works fine but when I create it dynamically the table is created and the fields are there in a dbgrid but on a post the record appears but it is empty

here's the code snippets again

var  RESLT1.: Tmemdataset;

RESLT1      := Tmemdataset.Create(self);
RESLT1.Name := RESLTName;   


R_Newfield: Tstringfield;

.newfieldname := 'RS_Number';
  R_Newfield   := TStringField.Create(self);
  with R_newfield do
  begin
    Name      := 'RESLT_' + IntToStr(RESLT1.fieldcount);
    Fieldname := newfieldname;
    fieldkind := fkdata;
    Size      := 20;
    DataSet   := RESLT1;
  end;


  newfieldname := 'Delta';
  R_Newfield   := TStringField.Create(self);
  with R_newfield do
  begin
    Name      := 'RESLT_' + IntToStr(RESLT1.fieldcount);
    Fieldname := newfieldname;
    fieldkind := fkdata;
    Size      := 10;
    DataSet   := RESLT1;
  end;

  RESLT1.Active := True;


    RESLT1.Append;
    RESLT1.FieldByName('RS_Number').AsString := SNPName;
    RESLT1.FieldByName('Delta').AsString     := '0';
    RESLT1.Post;     


                   

liewald

  • Full Member
  • ***
  • Posts: 144
Re: Linux 64 and memory resident database
« Reply #2 on: January 19, 2011, 02:49:21 pm »
Ok here's a solution

instead of using a field.create I used fielddefs

heres the code snippets

 RESLT1      := Tbufdataset.Create(self);
 RESLT1.Name := RESLTName; 

   RESLT1.FieldDefs.Add('RS_Number',ftString,20);
   RESLT1.FieldDefs.Add('Delta',ftString,20);
   RESLT1.CreateDataset;

  RESLT1.Active := True;


Ain't coding FUN!!!!!

 

TinyPortal © 2005-2018