You are not logged in.
Pages: 1
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)
Thanks, AOG and ab. There's so mutch information that I missed it. I'm using FPC 3.0
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.
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.
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?
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.
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?
No one will help a beginner who want's to learn mORMot framework?
I've done it already (see documentation)
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?
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?
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?
Pages: 1