You are not logged in.
Pages: 1
works as expected
thank you
Hi,
I use mormot with Delphi 2007, Anydac and firebird with the latest trunk i get rowCount with decimal :
{u'rowCount': 0.833333333333333, u'fieldCount': 6, ...
thank you
Hi,
I have found a possible cause in SynDBMidasVCL the TSynDBDataSet use a Dataset TSynDBSQLDataSet associated with the TDataSetProvider. If I override the InternalInitFieldDefs procedure of TSynDBSQLDataSet seem to work correctly
procedure TSynDBSQLDataSet.InternalInitFieldDefs;
var F: integer;
DBType: TFieldType;
lFields: TSQLDBColumnDefineDynArray;
begin
FieldDefs.Clear;
if fconnection = nil then
exit;
fconnection.GetFields(PSGetTableName, lFields);
for F := Low(lFields) to High(lFields) do
begin
with lFields[F] do
begin
case ColumnType of
SynCommons.ftInt64:
begin
DBType := db.ftLargeint;
end;
SynCommons.ftDate:
begin
DBType := db.ftDateTime;
end;
SynCommons.ftUTF8:
begin
if ColumnLength = 0 then
begin
DBType := db.ftWideMemo;
end
else
begin
DBType := db.ftWideString;
end;
end;
SynCommons.ftBlob:
begin
DBType := db.ftBlob;
end;
SynCommons.ftDouble, SynCommons.ftCurrency:
begin
DBType := db.ftFloat;
end
else
raise EDatabaseError.CreateFmt('GetFieldData ColumnType=%d', [ord(ColumnType)]);
end;
FieldDefs.Add(UTF8ToString(ColumnName), DBType, ColumnLength);
end;
end;
setLength(lFields, 0);
end;
Hi,
I have derived a simple component from TSynDBDataSet to override InternalInitFieldDefs procedure.
The component seem work fine except when I edit a record with 2 VarChar(2) field one with '13' and the next empty if the field are on a form with 2 Dbedit and I use Tab to cycle from Dbedit to another the value of the first field is copied to the next field.
procedure TMyMemDataSet.InternalInitFieldDefs;
var
lFields: TSQLDBColumnDefineDynArray;
DBType: TFieldType;
F: integer;
begin
if FieldDefs.Count > 0 then
exit;
if Connection = nil then
exit;
Connection.GetFields(PSGetTableName, lFields);
for F := Low(lFields) to High(lFields) do
begin
with lFields[F] do
begin
case ColumnType of
SynCommons.ftInt64:
begin
DBType := db.ftLargeint;
end;
SynCommons.ftDate:
begin
DBType := db.ftDateTime;
end;
SynCommons.ftUTF8:
if (ColumnLength = 0) then
begin
DBType := db.ftWideMemo;
end
else
begin
DBType := db.ftWideString;
end;
SynCommons.ftBlob:
begin
DBType := db.ftBlob;
end;
SynCommons.ftDouble, SynCommons.ftCurrency:
begin
DBType := db.ftFloat;
end
else
raise EDatabaseError.CreateFmt('GetFieldData ColumnType=%d', [ord(ColumnType)]);
end;
FieldDefs.Add(UTF8ToString(ColumnName), DBType, ColumnLength);
end;
end;
setLength(lFields, 0);
end;
p.s. I'm using Delphi XE 10.1
TIA
very interesting Martin... thank you
Thank you AB for the reply, good I wait for the new example.
I like DDD approach but I'm little confused on using it on very big application and how define contracts to write less code: i.e. write general interfaces like IRemoteSQL (validations? authorizations?) or an interface for every object.
Hi,
I need to rewrite a very big application with a legacy Firebird database using Delphi XE (now I’m using Delphi 2007).
The source code is over 2M lines of code and since the application contains more than 400 forms I need to separate it into different modules.
For the new application I need two things :
· separate the business logic from the forms (Views)
· create just a few modules that manages the application core parts. For example one module for the orders management,another one for the warehouse management,another one for the sells.
Is there a best practices for load plug-in (DLL or BPL) using interfaces for the Business logic?
Which is the correct way to use the mORMot solution ? Can I modularize mORMot validations and queries ?
For the forms I think to use this approach http://delphi.cjcsoft.net/viewthread.php?tid=44129 or similiar (I had tried Jedi plug-in and TMS)
thank you in advance
Hi to all I'm new here,
I'm using the alcinoe implementaions of TStringList: TALStringList and TALAVLStringList are quite fast. Look at xml parser is fast too.
http://sourceforge.net/projects/alcinoe/
I love the mORMot framework is a very good work, thank you A.B.
Pages: 1