Recent

Author Topic: Sqlite --> CreateTable but the DB file is 0Kb.  (Read 5775 times)

alepio

  • New Member
  • *
  • Posts: 23
Sqlite --> CreateTable but the DB file is 0Kb.
« on: December 10, 2008, 06:55:07 pm »
this is my simple code:
Quote
procedure TForm1.FormCreate(Sender: TObject);
begin
  Sqlite3Dataset1.TableName:='prova';
  Sqlite3Dataset1.Filename:= ExtractFilePath(application.ExeName) + 'data.db' ;
  ForceDirectories(ExtractFilePath(application.ExeName));
  with Sqlite3Dataset1 do
  begin
    FileName := ExtractFilePath(application.ExeName)  + 'data.db';
    if not TableExists then
    begin
      FieldDefs.Clear;
      FieldDefs.Add('Id', ftAutoInc);
      FieldDefs.Add('IdScanner', ftString);
      FieldDefs.Add('Action', ftString);
      FieldDefs.Add('Entrepot', ftString);
      FieldDefs.Add('Produit', ftMemo);
      FieldDefs.Add('DateInventaire', ftDate);
      FieldDefs.Add('HeureInventaire', ftTime);
      FieldDefs.Add('Stade', ftInteger);
      CreateTable;
    end;
    Open;
  end;
end;


This code create an file data.db 0Kb.
The function CreateTable result FALSE WHY?
the sqlite3.dll (for wince ) is the version 6.3.4.
Tks
Alessandro

alepio

  • New Member
  • *
  • Posts: 23
RE: Sqlite --> CreateTable but the DB file is 0Kb.
« Reply #1 on: December 11, 2008, 03:09:47 pm »
Help me!

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
RE: Sqlite --> CreateTable but the DB file is 0Kb.
« Reply #2 on: December 13, 2008, 02:41:08 pm »
Oh, one hint. In Windows CE there is no such thing as "application directory", so just putting the .DLL in the same dir as the EXE won't do. Put it in the Windows directory.

If that doesn't work, I don't know ... I rarely work with databases. Try asking in the lazarus mailling list. There are a couple of people there which use lazarus for wince and sqlite.

alepio

  • New Member
  • *
  • Posts: 23
RE: Sqlite --> CreateTable but the DB file is 0Kb.
« Reply #3 on: December 13, 2008, 06:21:50 pm »
That work!!
Is the Emulator that wrong.

 

TinyPortal © 2005-2018