Forum > Windows CE
Motorola MC3090 + sqlite
(1/1)
MrGruffi:
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 [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---unit Unit1; {$mode objfpc}{$H+} interface uses Classes, SysUtils, sqlite3conn, sqldblib, sqldb, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls; type { TForm1 } TForm1 = class(TForm) Button1: TButton; Button2: TButton; Edit1: TEdit; Edit2: TEdit; Label1: TLabel; Label2: TLabel; SQLDBLibraryLoader1: TSQLDBLibraryLoader; Connect1: TSQLite3Connection; SQLQuery1: TSQLQuery; SQLTrans1: TSQLTransaction; procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); procedure FormCreate(Sender: TObject); private public end; var Form1: TForm1; implementation {$R *.frm} { TForm1 } procedure TForm1.FormCreate(Sender: TObject);begin SetBounds(0,22,Screen.Width,Screen.Height); try SQLDBLibraryLoader1.ConnectionType:= 'SQLite3'; SQLDBLibraryLoader1.LibraryName:= 'sqlite3.dll'; SQLDBLibraryLoader1.Enabled:= True; except Label1.Caption:= 'sqlite3.dll fault'; end;end; procedure TForm1.Button2Click(Sender: TObject);begin Application.Terminate;end; procedure TForm1.Button1Click(Sender: TObject);begin begin Connect1.DatabaseName:= 'test.db'; Connect1.Connected:= True; SQLQuery1.SQL.Clear; if FileExists('bazatest.db') then begin SQLQuery1.SQL.Clear; SQLQuery1.SQL.Add('insert into nuser(id, imie) values (:id_e, :name_e)'); SQLQuery1.Params.paramByName('id_e').AsString := Edit1.Text; SQLQuery1.Params.paramByName('name_e').AsString := Edit2.Text; SQLQuery1.ExecSQL; SQLTrans1.Active:= True; SQLTrans1.Commit; SQLQuery1.Close; end else begin ShowMessage('fault!'); end; end;end; end.
I don't know whot is wrong :(
Could you help me Guys, please.
bambamns:
Hi,
First , AFAIK you need to proivde full path on WinCE for database.
Second , why do you use SQLDBLibraryLoader ?
Third , you are connecting to Connect1.DatabaseName:= 'test.db'; and after you search for if FileExists('bazatest.db') - test.db and bazatest.db are not the same file.
Fourth , do you use sqlite3.dll for wince ?
And last - I have tried to use Typhon several times for WinCe and run to lot of problems so I still use plain Lazarus + cross arm wince addon (still with fpc 2.6.4).
Iwoks:
Hay!
If you using a arm-wince
Take sqlite3.dll for wince and paste this file in your .exe directory.
http://www.iwoks.net/download/sqlite3.dll
I use this lpk for sqlite3
http://www.iwoks.net/download/SQLite3.zip
Best regard.
Thaddy:
--- Quote from: Iwoks on November 02, 2018, 04:14:02 pm ---Hay!
If you using a arm-wince
Take sqlite3.dll for wince and paste this file in your .exe directory.
http://www.iwoks.net/download/sqlite3.dll
I use this lpk for sqlite3
http://www.iwoks.net/download/SQLite3.zip
Best regard.
--- End quote ---
There is no single dll for wince. It depends on the platform: arm - even the correct architecture - , intel, mips.... make sure you have a correct one or compile it yourself. sqlite3 is easy to compile even for noobs.
Navigation
[0] Message Index