#1 Re: mORMot 1 » sample 27 and people.json » 2016-01-21 08:16:08

Okay. But who's responsible for the path settings. Off course I can override the path settings to people.json in the sample to get it right (i think)

#2 Re: mORMot 1 » syncrosplatform.pas: eroor function setProperty » 2016-01-21 08:12:50

Thanks, AOG and ab. There's so mutch information that I missed it. I'm using FPC 3.0

#3 mORMot 1 » sample 27 and people.json » 2016-01-20 15:16:22

jkuiper
Replies: 3

I've compiled the fpc client which is working good. Now I have copied the executable to another pc. Running it gave me the following error:

unable to open file ..\..\..\..\people.json.

I can't find the reference in server as client to the file.

Where can I change the path to this file.

#4 mORMot 1 » syncrosplatform.pas: eroor function setProperty » 2016-01-20 13:34:34

jkuiper
Replies: 3

I'm trying sample 27, which using crosplatform. first I compiled it in Delphi. Works okay.
Now I'm compiling the fpc version, but get a compiler error:

    {$ifdef FPC_VARIANTSETVAR} // see [url]http://mantis.freepascal.org/view.php?id=26773[/url]
    function SetProperty(var V: TVarData; const Name: string;
      const Value: TVarData): Boolean; override;
    {$else}
-->    function SetProperty(const V: TVarData; const Name: string;
      const Value: TVarData): Boolean; override;
    {$endif}                                  

Compile Project, Target: LCLClient.exe: Exit code 1, Errors: 2
SynCrossPlatformJSON.pas(224,14) Error: function header doesn't match the previous declaration "SetProperty(const tvardata;const AnsiString;const tvardata):Boolean;"
Error: Found declaration: SetProperty(var tvardata;const AnsiString;const tvardata):Boolean;

Changing the const to var in the class was the solution. Please change it in trunk.

#5 mORMot 1 » mORMot and winCE » 2016-01-19 12:57:40

jkuiper
Replies: 4

I try to compile the client from sample 4 (http client server) in Lazarus for Wince. The compiler stops in file synzip by this line

  {$ifndef ANDROID}
  clocale,
  {$endif}

Are there rules to use mORMot on WinCE?
Has anyone mORMot working on WinCE?

#6 Re: mORMot 1 » Delphi vs Lazarus » 2016-01-15 15:06:02

Found a topic about this unit. Is there another way to use UI to fill a DBGrid in lazarus?

#7 Re: mORMot 1 » Delphi vs Lazarus » 2016-01-15 15:02:04

Okay, the problem relies on mORMotUI.pas. Is lazarus 1.6RC still depending on the RTTI patch? I've got an connection now, but can't using the DBGrid to show data.

#8 mORMot 1 » Delphi vs Lazarus » 2016-01-15 14:49:27

jkuiper
Replies: 3

I used this sample to test my connection with ZEOS.MySQL (thanks for it). In Delphi (D10 seattle) it works like a charm. But I need a lazarus/fpc environment for wince.
I create the same sample in Lazarus. But when compiiling, it occurs an error

mORMoti18n.pas(895,19) Error: Illegal qualifier

What's the difference between those two?

#9 Re: mORMot 1 » Database connection error with ZEOS » 2016-01-12 08:18:20

No one will help a beginner who want's to learn mORMot framework?

#10 Re: mORMot 1 » DBExlorer with ZEOS » 2016-01-08 08:22:36

I've done it already (see documentation)

#11 mORMot 1 » Database connection error with ZEOS » 2016-01-07 12:50:08

jkuiper
Replies: 2

My real goal is to connect a databaseserver and get data remotely.
My own first example is working (both Delphi/Lazarus). I created a SQLite database and put some data in it.

My own second example connects to a database server (MariaDB 5.5). I looked in the manual and took the code from chapter 8.1  (Lazarus 1.6Rc1/ FPC 3.0):

unit Unit1;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
  SynCommons,  mORMot, mORMotSQLite3, SynSQLite3Static,
  mORMotDB,  synDB,  
  SynDBZeos, // needed for Zeos
  ZDbcMySql; // needed for Zeos


type

  { TForm1 }

  TForm1 = class(TForm)
    Button1: TButton;
    Memo1: TMemo;
    procedure Button1Click(Sender: TObject);
  private
    procedure UseProps(Props: TSQLDBConnectionProperties);
    { private declarations }
  public
    { public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.lfm}

{ TForm1 }

procedure TForm1.Button1Click(Sender: TObject);
var Props: TSQLDBConnectionProperties;
    Server : string;
begin
  Server := 'zdbc:mysql://192.168.x.x:3306/test?username=xxx;password=xxx';
  Props := TSQLDBZEOSConnectionProperties.Create(Server,'test','','');
  try
    UseProps(Props);
  finally
    Props.Free;
  end;
end;

procedure TForm1.UseProps(Props: TSQLDBConnectionProperties);
var I: ISQLDBRows;
begin
  I := Props.Execute('select * from gebruikers where id = ?',['1']);
  showmessage(I.Column['login']);
end;

end.

Examples compiles without problem, but when I want to get data from the database, I get this error:

Project voorbeeld2 raised exception class 'External: SIGSEGV'.

In file 'C:\lazarus16RC1\components\zeoslib714\src\plain\ZPlainMySqlDriver.pas' at line 1240:
Result := PMYSQL_ROW(ROW)[Offset];

It looks the database will not be connected. Is my code wrong or do I have to do something else?

#12 mORMot 1 » DBExlorer with ZEOS » 2016-01-07 11:37:45

jkuiper
Replies: 7

I've installed ZEOS 7.2 in My Delphi 10 Seattle. Loaded the source in the IDE and ran it.
This gave me the opportunity to create a connection. Therefore I select ZEOS which my MySQL database will be connected. I put the libmysql.dll in windows\system32.

The database connection will not be executed:

Project SynDBExplorer.exe raised exception class EZSQLException with message 'Requested database driver was not found'.


Do I have something to do extra to connect my MySQL/MariaDB database with ZEOS?

#13 mORMot 1 » First time issues » 2014-11-24 20:48:37

jkuiper
Replies: 5

I'm using mormot framework for the first time.
I'm running Lazarus 1.2.6 / FPC 2.6.4. on Windows Vista 32 bits.
Download the snaphot, sqlite obj files and the sqlitefpc from the website. Extract the files into c:\lazarus\mormot. Went to c:\lazarus\mormot\sqlite3 and loaded testsql.lpi into lazarus IDE. Built the files but comes with the error:

TestSQL3.dpr(169,1) Warning: Library fpc-win32\libkernel32.a not found, Linking may fail !
TestSQL3.dpr(169,1) Warning: Library fpc-win32\libgcc.a not found, Linking may fail !
TestSQL3.dpr(169,1) Error: Can't open object file: fpc-win32\libkernel32.a
TestSQL3.dpr(169,1) Error: Can't open object file: fpc-win32\libgcc.a
TestSQL3.dpr(169,1) Error: Undefined symbol: ___moddi3
TestSQL3.dpr(169,1) Error: Undefined symbol: ___divdi3
TestSQL3.dpr(169,1) Error: Undefined symbol: ___umoddi3
TestSQL3.dpr(169,1) Error: Undefined symbol: ___udivdi3
TestSQL3.dpr(169,1) Error: Undefined symbol: ___chkstk_ms
TestSQL3.dpr(169,1) Error: Undefined symbol: _LeaveCriticalSection@4
TestSQL3.dpr(169,1) Error: Undefined symbol: _EnterCriticalSection@4
TestSQL3.dpr(169,1) Error: Undefined symbol: _InterlockedCompareExchange@12
TestSQL3.dpr(169,1) Error: Undefined symbol: _DeleteCriticalSection@4
TestSQL3.dpr(169,1) Error: Undefined symbol: _GetCurrentThreadId@0
TestSQL3.dpr(169,1) Error: Undefined symbol: _InitializeCriticalSection@4
TestSQL3.dpr(169,1) Error: Undefined symbol: _CloseHandle@4
TestSQL3.dpr(169,1) Error: Undefined symbol: _TryEnterCriticalSection@4
TestSQL3.dpr(169,1) Error: Undefined symbol: _AreFileApisANSI@0
TestSQL3.dpr(169,1) Error: Undefined symbol: _CreateFileA@28
TestSQL3.dpr(169,1) Error: Undefined symbol: _CreateFileW@28
TestSQL3.dpr(169,1) Error: Undefined symbol: _CreateFileMappingA@24
TestSQL3.dpr(169,1) Error: Undefined symbol: _CreateFileMappingW@24
TestSQL3.dpr(169,1) Error: Undefined symbol: _CreateMutexW@12
TestSQL3.dpr(169,1) Error: Undefined symbol: _DeleteFileA@4
TestSQL3.dpr(169,1) Error: Undefined symbol: _DeleteFileW@4
TestSQL3.dpr(169,1) Error: Undefined symbol: _FlushFileBuffers@4
TestSQL3.dpr(169,1) Error: Undefined symbol: _FormatMessageA@28
TestSQL3.dpr(169,1) Error: Undefined symbol: _FormatMessageW@28
TestSQL3.dpr(169,1) Error: Undefined symbol: _GetCurrentProcessId@0
TestSQL3.dpr(169,1) Error: Undefined symbol: _GetDiskFreeSpaceA@20
TestSQL3.dpr(169,1) Error: Undefined symbol: _GetDiskFreeSpaceW@20
TestSQL3.dpr(169,1) Error: Undefined symbol: _GetFileAttributesA@4
TestSQL3.dpr(169,1) Error: Undefined symbol: _GetFileAttributesW@4
TestSQL3.dpr(169,1) Error: Undefined symbol: _GetFileAttributesExW@12
TestSQL3.dpr(169,1) Error: Undefined symbol: _GetFileSize@8
TestSQL3.dpr(169,1) Error: Undefined symbol: _GetFullPathNameA@16
TestSQL3.dpr(169,1) Error: Undefined symbol: _GetFullPathNameW@16
TestSQL3.dpr(169,1) Error: Undefined symbol: _GetLastError@0
TestSQL3.dpr(169,1) Error: Undefined symbol: _GetSystemInfo@4
TestSQL3.dpr(169,1) Error: Undefined symbol: _GetSystemTime@4
TestSQL3.dpr(169,1) Error: Undefined symbol: _GetSystemTimeAsFileTime@4
TestSQL3.dpr(169,1) Error: Undefined symbol: _GetTempPathA@8
TestSQL3.dpr(169,1) Error: Undefined symbol: _GetTempPathW@8
TestSQL3.dpr(169,1) Error: Undefined symbol: _GetTickCount@0
TestSQL3.dpr(169,1) Error: Undefined symbol: _GetVersionExA@4
TestSQL3.dpr(169,1) Error: Undefined symbol: _GetVersionExW@4
TestSQL3.dpr(169,1) Error: Undefined symbol: _HeapAlloc@12
TestSQL3.dpr(169,1) Error: Undefined symbol: _HeapCreate@12
TestSQL3.dpr(169,1) Error: Undefined symbol: _HeapDestroy@4
TestSQL3.dpr(169,1) Error: Undefined symbol: _HeapFree@12
TestSQL3.dpr(169,1) Error: Undefined symbol: _HeapReAlloc@16
TestSQL3.dpr(169,1) Error: Undefined symbol: _HeapSize@12
TestSQL3.dpr(169,1) Fatal: There were 50 errors compiling module, stopping

Searched on the internet and found that it's better to use sqlite3.dll for the first time. Just add the line {$define NOSQLITE3STATIC} in mormot.inc.
This built the files into a executable. Ran this and gave me this message

! Exception ESQLLite3Exeption raised with message:
! No SQLite3 library available: you shall either add SynSqlite3static to your project uses clause, either set sqlite3 := TSQLiteLibraryDynamic.create to load sqlite3.dll

Now I have a few questons:
How do I create static connection?
What is demo 1 in samples really doing? I can fill my name and a message, put on the button send message, but see nothing happens. But button 'find the previous message' gives the message not found.
Demo 2 can't find sqlite.dll. Put this in c:\windows\system32. Now it runs and I see the same as demo 1. But what does it do?

Board footer

Powered by FluxBB