[Lazarus] codetool consistence exception

Martin Friebe lazarus at mfriebe.de
Wed Oct 1 21:51:42 CEST 2008


Hello, I have a SQLite3 database and I want to send the records by lNet
components.

I need to create a string from the fields of the table.

I have this:

  with DataModule1.Db do
    begin
      TableName := 'Item';
      if not TableExists then
      begin
        FieldDefs.Clear;
        FieldDefs.Add('Code',ftAutoInc); // ftAutoInc con ftString hce falta
establecer una clave primaria PrimaryKey := 'Code';
        FieldDefs.Add('Description',ftString);
        FieldDefs.Add('Stock',ftBoolean);
        CreateTable;
      end;
    end;

records:
1, Description1, False
2, Description2, False
3, Description3, True

and I want to create a string, for example:

1#Description1#False

to send this by lNet.

I do this:

sequence := Db.FieldValues['Code'] + '#' <'@'> +
                   Db.FieldValues['Proveedor'] + '#' <'@'> +
                   Db.FieldValues['Almacen'] + '#' <'@'> +
                   Db.FieldValues['Unidades'];

but I get the following error: Project raised exception class
'RunError(231)'.

Two things:

1.- Which is the correct form to generate the string?
2.- It is necessary to beforehand know the name the fields to generate the
string?

I want something like this:

for i:= 1 to Db.FieldCount do
  Db.FieldValues[i];

Regards.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20081001/b8ee1ae2/attachment-0007.html>


More information about the Lazarus mailing list