Recent

Author Topic: A bug or i m doing something wrong | MemDataSet  (Read 1222 times)

cpalx

  • Hero Member
  • *****
  • Posts: 651
A bug or i m doing something wrong | MemDataSet
« on: April 24, 2015, 12:16:58 am »
Lazarus: 1.2.4
FPC: 2.6.4
SO: Ubuntu(KDE)  and Windows 2008



Code: [Select]
   MymemDataSet.FieldDefs.Add( 'Names', ftString );
   MymemDataSet.Active := true;

for i:= 0 to 10 do begin
   MymemDataSet.insert;
   MymemDataSet.FieldByName( 'Names' ).AsString:= 'This is a test ' + IntToStr( i );
   MymemDataSet.post

end;

This Add 11 records, by all of them are empty

if a change by Integer, the inserts are OK.
« Last Edit: April 24, 2015, 12:27:20 am by cpalx »

miab3

  • Full Member
  • ***
  • Posts: 115
Re: A bug or i m doing something wrong | MemDataSet
« Reply #1 on: April 24, 2015, 12:58:11 am »
Try:

Code: [Select]
...
MymemDataSet.FieldDefs.Add( 'Names', ftString, 30 ); // <<== add , 30
...

Michal

cpalx

  • Hero Member
  • *****
  • Posts: 651
Re: A bug or i m doing something wrong | MemDataSet
« Reply #2 on: April 24, 2015, 01:02:09 am »
Thanks

 

TinyPortal © 2005-2018