* * *

Author Topic: Motorola MC3090 + sqlite  (Read 651 times)

MrGruffi

  • Newbie
  • Posts: 1
Motorola MC3090 + sqlite
« on: June 29, 2018, 03:07:34 pm »
Hello,
I'm trying connect to SQLite database for WinCE, compiles the program in Typhon.
I downloaded the dll library for wince but when i run the program I get message "TApplication.HandleException Connect1 : no such table: nuser".
When I run the same program on windows 32 bit work fine.
Could you help  me whot I do wrong.
Here is my source code:
Code: Pascal  [Select]
  1. unit Unit1;
  2.  
  3. {$mode objfpc}{$H+}
  4.  
  5. interface
  6.  
  7. uses
  8.   Classes, SysUtils, sqlite3conn, sqldblib, sqldb, FileUtil, Forms,
  9.   Controls, Graphics, Dialogs, StdCtrls;
  10.  
  11. type
  12.  
  13.   { TForm1 }
  14.  
  15.   TForm1 = class(TForm)
  16.     Button1: TButton;
  17.     Button2: TButton;
  18.     Edit1: TEdit;
  19.     Edit2: TEdit;
  20.     Label1: TLabel;
  21.     Label2: TLabel;
  22.     SQLDBLibraryLoader1: TSQLDBLibraryLoader;
  23.     Connect1: TSQLite3Connection;
  24.     SQLQuery1: TSQLQuery;
  25.     SQLTrans1: TSQLTransaction;
  26.     procedure Button1Click(Sender: TObject);
  27.     procedure Button2Click(Sender: TObject);
  28.     procedure FormCreate(Sender: TObject);
  29.   private
  30.  
  31.   public
  32.  
  33.   end;
  34.  
  35. var
  36.   Form1: TForm1;
  37.  
  38. implementation
  39.  
  40. {$R *.frm}
  41.  
  42. { TForm1 }
  43.  
  44. procedure TForm1.FormCreate(Sender: TObject);
  45. begin
  46.    SetBounds(0,22,Screen.Width,Screen.Height);
  47.  
  48.   try
  49.     SQLDBLibraryLoader1.ConnectionType:= 'SQLite3';
  50.      SQLDBLibraryLoader1.LibraryName:= 'sqlite3.dll';
  51.     SQLDBLibraryLoader1.Enabled:= True;
  52.   except
  53.     Label1.Caption:= 'sqlite3.dll fault';
  54.   end;
  55. end;
  56.  
  57. procedure TForm1.Button2Click(Sender: TObject);
  58. begin
  59.   Application.Terminate;
  60. end;
  61.  
  62. procedure TForm1.Button1Click(Sender: TObject);
  63. begin
  64.   begin
  65.       Connect1.DatabaseName:= 'test.db';
  66.       Connect1.Connected:= True;
  67.       SQLQuery1.SQL.Clear;
  68.       if FileExists('bazatest.db') then
  69.          begin
  70.  
  71.             SQLQuery1.SQL.Clear;
  72.             SQLQuery1.SQL.Add('insert into nuser(id, imie) values (:id_e, :name_e)');
  73.             SQLQuery1.Params.paramByName('id_e').AsString := Edit1.Text;
  74.             SQLQuery1.Params.paramByName('name_e').AsString := Edit2.Text;
  75.             SQLQuery1.ExecSQL;
  76.             SQLTrans1.Active:= True;
  77.             SQLTrans1.Commit;
  78.  
  79.             SQLQuery1.Close;
  80.  
  81.  
  82.       end else
  83.       begin
  84.         ShowMessage('fault!');
  85.       end;
  86.   end;
  87. end;
  88.  
  89. end.
  90.  

I don't know whot is wrong :(
Could you help me Guys, please.

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus