You are not logged in.
Pages: 1
great, but not all look fine.
original code
// 2. handle missing .msg file
LanguageForLanguageFile := aLanguage;
if LanguageForLanguageFile<>lngEnglish then
if not FileExists(TLanguageFile.FileName(LanguageForLanguageFile)) then begin
if aForceEnglishIfNoMsgFile then
if CurrentLanguage.Index=lngEnglish then
exit else
aLanguage := lngEnglish;
LanguageForLanguageFile := lngEnglish; // no .msg -> no translation
end;
dates look bad, not default view dd.mm.yyyy
if change
// 2. handle missing .msg file
LanguageForLanguageFile := aLanguage;
if LanguageForLanguageFile<>lngEnglish then
if not FileExists(TLanguageFile.FileName(LanguageForLanguageFile)) then begin
if aForceEnglishIfNoMsgFile then
if CurrentLanguage.Index=lngEnglish then
exit else
aLanguage := lngEnglish;
LanguageForLanguageFile := lngRussian; // CHANGED TO lngRussian
end;
dates look fine
Do not know why such a difference
any news?
users dont update soft and do not fill last add field
Database name remains of the alteration code, you are right, i rename it.
We may have to add a new feature for model comparison at connection, as we do for interface-based services: the client would send its current model to the server, so that it would be checked against the server expectations.
thanks.
ok, but how read GetUserVersion or user_version in client?
GetUserVersion - declared protected
code init client side:
var
Database: TSQLRestClientURI;
...
function InitClient: Boolean;
begin
Result := True;
Model := CreateModel;
ReadConfig;
Database := TSQLHttpClient.Create(ip, port, Model);
DataBase.ForceBlobTransfert := True;
if not Database.ServerTimeStampSynchronize then Result := False;
end;
well if you could use as
function InitClient: Boolean;
begin
Result := True;
Model := CreateModel;
ReadConfig;
Database := TSQLHttpClient.Create(ip, port, Model);
DataBase.GetUserVersion < 2 then begin
Showmessage('blabla');
Result := False;
Exit;
end
if not Database.ServerTimeStampSynchronize then Result := False;
end;
i have 2 version same programm
v1.0 and v1.1. In version 1.1 add new field.
i send new version all users but many users work in old 1.0 version and new field dont save.
how to determine that you are using an older version and the message?
mpv can you put here your implementation?
Пишу интеграцию с единой регистратурой (ФЕР), они используют протокол SOAP и ничего кроме него(. Если поделишься реализацией будет просто чудестно.
Spidermonkey has passed V8 on Octane performance on arewefastyet, and is now leading V8 and JSC on Octane, Sunspider and Kraken.
http://robert.ocallahan.org/2014/10/are … e-are.html
please fix link, file not found
hm, very strange.
rewrite server with 10 - Background Http service and try use xxx /install and danielkuettner command - it works!
thanks for advise danielkuettner, but i dont know why new version broken /start command, may be not execute procedure TSQLite3HttpService.DoStart(Sender: TService)?
i update mormot and recompile my background service and he broken - not work. I rollback to old mormot folder and service work fine, again change folder to new mormot and broken.
i run sample 10 - Background Http service and he broken too///
log on /install:
20140905 15080316 trace mORMotHttpServerService="ssStopped"
20140905 15080316 info Controling mORMotHttpServerService with command "/install"
20140905 15080316 OSERR CreateService("mORMotHttpServerService","mORMot Http Server Service") "Указанная служба уже существует" (1073) stack trace API 00528B12 005A77BA 005A7DB6 006345A7 00639D3E 7C817077
20140905 15080316 trace Quitting command line
20140905 15080316 trace mORMotHttpServerService="ssStopped"
log on /start
20140905 15080437 trace mORMotHttpServerService="ssStopped"
20140905 15080437 info Controling mORMotHttpServerService with command "/start"
20140905 15080443 OSERR TServiceController(00C84F90) Start "Служба не ответила на запрос своевременно" (1053) stack trace API 00528C02 005A7C92 005A7E56 006345A7 00639D3E 7C817077
20140905 15080443 trace Quitting command line
20140905 15080443 trace mORMotHttpServerService="ssStopped"
thank you very much for your help, this is true, there are no memory leaks
is not the problem if you comment out these lines, the error is still there.
if pic <> '' then begin
// img.Picture := nil;
// img.Picture.Assign(LoadFromRawByteString(pic));
LoadFromRawByteString(pic)
end;
error somewhere in the bowels function LoadFromRawByteString
I'm writing a simple directory to save the jewelry filtration. With the active use vyhodito error "Not enough memory to process this command", it generates a scroll pages back and forth.
I wrote a test case showing the problem. I'm on the 2950-2960 iteration pops overflow memory.
Please help solve the problem!
https://www.dropbox.com/s/zg0629isv7d7w … String.zip
TSQLProduct = class(TSQLRecord)
private
fPreview: TSQLRawBlob;
public
published
property preview: TSQLRawBlob read fPreview write fPreview;
end;
var
Form1: TForm1;
Database: TSQLRestClientURI;
Server: TSQLRestServerDB;
model: TSQLModel;
implementation
{$R *.dfm}
function CreateModel: TSQLModel;
begin
result := TSQLModel.Create([TSQLProduct]);
end;
procedure InitClient;
begin
Model := CreateModel;
Database := TSQLRestClientDB.Create(Model, CreateModel, 'test.db3', TSQLRestServerDB);
if Database = nil then Exit;
DataBase.ForceBlobTransfert := True;
TSQLRestClientDB(Database).Server.CreateMissingTables(0);
end;
procedure FinalizeClient;
begin
Server.Free;
Database.Free;
Model.Free;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
i, j, c: Integer;
jpg: TJPEGImage;
pic: RawByteString;
prd: TSQLProduct;
begin
c := 0;
for j := 1 to 1000 do begin
for i := 1 to 1000 do begin
prd := TSQLProduct.Create(Database, i, False);
try
pic := prd.preview;
inc(c);
Caption := IntToStr(c);
if pic <> '' then begin
img.Picture := nil;
img.Picture.Assign(LoadFromRawByteString(pic));
end;
finally
FreeAndNil(prd);
end;
Application.ProcessMessages
end;
end;
end;
initialization
Gdip := TGDIPlusFull.Create;
InitClient;
finalization
FinalizeClient();
end.
extension-functions.c (50.96 KB) contributed by Liam Healy on 2010-02-06 15:45:07
Provide mathematical and string extension functions for SQL queries using the loadable extensions mechanism. Math: acos, asin, atan, atn2, atan2, acosh, asinh, atanh, difference, degrees, radians, cos, sin, tan, cot, cosh, sinh, tanh, coth, exp, log, log10, power, sign, sqrt, square, ceil, floor, pi. String: replicate, charindex, leftstr, rightstr, ltrim, rtrim, trim, replace, reverse, proper, padl, padr, padc, strfilter. Aggregate: stdev, variance, mode, median, lower_quartile, upper_quartile.
how can unzip password protected zip?
ups, you absolutly right
part of Person Class
TSQLPerson = class(TSQLRecord)
private
fFam, fIm, fOt,
fSex: string;
fDr: TDateTime;
...
published
property Fam: string read fFam write fFam;
property Im: string read fIm write fIm;
property Ot: string read fOt write fOt;
property Sex: String read fSex write fSex;
property Dr: TDateTime read fDr write fDr;
...
end;
part of Patients Class
TSQLPatients = class(TSQLPerson)
private
fMO: Integer;
fFizRazv: string;
fMass, fRost: Real;
...
published
property MO: Integer read fMO write fMO;
property FizRazv: string read fFizRazv write fFizRazv;
property Mass: Real read fMass write fMass;
property Rost: Real read fRost write fRost;
...
end;
procedure update Medical organization code (MO)
procedure TfrmMain.SetMO;
var
i: Integer;
patients: TSQLPatients;
ids: TIntegerDynArray;
begin
if TablePatients = nil then Exit;
patients := TSQLPatients.Create;
try
patients.FillPrepare(TablePatients);
if Database.TransactionBegin(TSQLPatients) then
try
Database.BatchStart(TSQLPatients);
while patients.FillOne do begin
patients.MO := MOs.ID;
Database.BatchUpdate(patients);
end;
Database.BatchSend(ids);
Database.Commit;
ShowNotification('МО успешно обновлено');
except
ShowNotification('Ошибка при обновлении');
Database.RollBack;
end;
finally
FreeAndNil(patients);
end;
end;
patients.FillOne fill only TSQLPerson date (Fam, Im, Ot, Sex...) and no one TSQLPatients (MO, FizRazv...)
how search hidden id?
Table := Database.ExecuteList([], 'select Id, TipogNum, Fam, Im, Ot, DateBorn, MestoRab from DataRecord');
ttg := TSQLTableToGrid.Create(dgDataRecord, Table, Database);
ttg.OnValueText := OnListText;
ttg.IDColumnHide; //if comment this line i bring search result
dgDataRecord.Row := Table.SearchValue('5', 1, 0, nil); // search record with id = 5
I'm trying to determine the visibility of the ID column but the result lie all the time
in documentation:
function IDColumnHide: boolean;
- return true is ID was succesfully hidden, false if not possible
in code:
function TSQLTable.IDColumnHide: boolean;
var FID,R,F: integer;
S,D1,D2: PPUTF8Char;
begin
// 1. check if possible
result := false;
if (self=nil) or Assigned(fIDColumn) or (FieldCount<=1) then
exit; // already hidden or not possible <<<--- always false if hidden
Table := Database.ExecuteList([], 'select * from base');
TSQLTableToGrid.Create(DrawGrid, Table, Database);
how to change the header of the received table? I want to Russify them, as I understood the module to change the SQLite3i18n prednaznichen not dynamically change the text
i see manyadd, manydelete and they work fine, but how update TSQLRecordMany?
i load data to sqlite database from csv, procedure work fine:
class procedure TSQLPopulation.CreatePopulation(const ADatabase: TSQLRest);
var
i, j: integer;
population: TSQLPopulation;
sl, slES: TStringlist;
begin
sl := TStringList.Create;
sl.LoadFromFile('Population.csv');
slES := TStringList.Create;
for i := 0 to sl.Count - 1 do begin
slES.Clear;
ExtractStrings([';'], [' '], PChar(sl.Strings[i]), slES);
population := TSQLPopulation.Create(Database, 'Region = "%"', [slES.Strings[0]]);
try
with population do
if ID = 0 then begin
fRegion := slES.Strings[0];
fAll2011 := StrToInt(slES.Strings[1]);
fM2011 := StrToInt(slES.Strings[2]);
fW2011 := StrToInt(slES.Strings[3]);
FAll2012 := StrToInt(slES.Strings[4]);
fM2012 := StrToInt(slES.Strings[5]);
fW2012 := StrToInt(slES.Strings[6]);
Database.Add(population, true);
end
finally
FreeAndNil(population);
end;
end;
sl.Free;
slES.Free;
end;
but i want to automate the bypass fields
class procedure TSQLPopulation.CreatePopulation(const ADatabase: TSQLRest);
var
i, j: integer;
population: TSQLPopulation;
sl, slES: TStringlist;
v: Variant;
begin
sl := TStringList.Create;
sl.LoadFromFile('Population.csv');
slES := TStringList.Create;
for i := 0 to sl.Count - 1 do begin
slES.Clear;
ExtractStrings([';'], [' '], PChar(sl.Strings[i]), slES);
population := TSQLPopulation.Create(Database, 'Region = "%"', [slES.Strings[0]]);
try
with population do
if ID = 0 then begin
for j := 0 to slES.Count - 1 do begin
v := slES.Strings[j];
SetFieldVarData(j , TVarData(v));
end;
Database.Add(population, true);
end
finally
FreeAndNil(population);
end;
end;
sl.Free;
slES.Free;
end;
and this code not work(((
thanks for quick reply i used old documentation
in sample synopse-sqlite-demo only many to many tables link.
i try create one to many but error: stack overflow(
i not found in documentation information.
need link on address to many users
may be any write new sample advanced using drawgrid with new features framework?
issue if i add in uses section SQLite3UI (SQLite3i18n include in SQLite3UI)
my standart system LCID 1049 - ru
but if i only add in uses section SQLite3i18n all my setting get english format.
SetCurrentLanguage(LCIDToLanguage(SysLocale.DefaultLCID));
in my pc this function set always lngEnglish, but get russian local parameters SysLocale.DefaultLCID = 1049
if CurrentLanguage.Index=aLanguage then
exit;
{$ifdef USEFORMCREATEHOOK}
if CurrentLanguage.Index<>LANGUAGE_NONE then
raise Exception.Create('lang unit: language must be set only once');
{$endif USEFORMCREATEHOOK}
// 2. file must exists if not English
if aLanguage<>lngEnglish then
if not FileExists(TLanguageFile.FileName(aLanguage)) then
if CurrentLanguage.Index=lngEnglish then
exit else
aLanguage := lngEnglish; // if .msg not available -> force english <<<<<<< always english, but why not default system language? <<<<<<<
i try use UnicodeComparison, but search dont work.
0 result if i search russian or english letter (((
i solve problem create 2 search:
Rec := TSQLDataRecord.Create(Database, 'Field like "%' + edtSearch.Text + '%"'); //first i search Field
r := Table.SearchValue(IntToStr(Rec.ID), 1, 0, nil); //second i search id in table
if r <> 0 then dgDataRecord.Row := r;
Don't forget to use StringToUTF8(edtSearch.Text) to provide an UTF-8 encoded text.
i use Delphi 2010 - all strings in unicode
then i write
procedure TfrmMain.btnSearchClick(Sender: TObject);
var
r: integer;
begin
r := Table.SearchValue(edtSearch.Text, 1, btnSearch.Tag, dgDataRecord);
if r <> 0 then dgDataRecord.Row := r;
end;
if i search english letter or number it works fine, but russian letter not found
if source code i see const aUpperValue: RawUTF8;, but Search: PAnsiChar; why not utf8 search?
thanks for buatiful framework!
may be any write simple sample for using SQLite3i18n language file?
Pages: 1