#51 mORMot 1 » tsqlTable and Dataset » 2014-12-21 12:19:46

lele9
Replies: 4

hi ab,
if i use mormotVCL unit to create Dataset from tSQLTable, how can i have a check column to select/unselect row(s) like in tDrawGrid used in TSQLtableToGrid?
thanks,
Emanuele.

#52 mORMot 1 » mvc desktop application » 2014-11-05 17:49:02

lele9
Replies: 0

hi ab,
im so interested in new mvc mormot functionality, so i would use to desktop application.
what is the step to implement it?
thanks,
Emanuele.

#53 Re: mORMot 1 » MVC/MVVM Web Applications with mORMot! » 2014-10-27 10:33:20

great work ab!
do you think is possible the same structure for desktop application?

#54 Re: mORMot 1 » mormot on android » 2014-10-24 06:22:17

thanks ab and warleyalex for your suggest.
i think fmx with xe7 is a good solution for me. any working example?

#55 mORMot 1 » mormot on android » 2014-10-23 16:50:27

lele9
Replies: 3

hi ab,
at now which possibilities there are to develop a mormot client appication running on android device?
any running salmpes?
please consider that i'm totally newbie to android development, but i would like to write a first simple android client for my mormot desktop application.
thanks,
Emanuele.

#56 mORMot 1 » tcreatetime wrong » 2014-09-18 10:15:27

lele9
Replies: 1

hi ab,
i have seen just now that the TCreateTime property are always 2 hours less the time of system. why?
i try on different computer but it's the same.
i read that TCreateTime is from ServerTimeStamp that depend from Datetime of server machine but im sure that the server have the correct date time (i try more than one server).
can you help me?
thanks,
Emanuele.

#57 Re: mORMot 1 » tcollection or tdynarray and select » 2014-09-06 06:21:21

i try to explain the scenarios...
i have a TSQLPerson with a TCollection (but could be a tdynarray also) property "ContactDetails" where i store telephon numbers, emails etc etc.
Now, what i want, is retrieve a TSQLTable (ExecuteList with a personalized query) that contains (just one!) contactDetail (for example the contactDetail marked as "default").
is possible?

#58 mORMot 1 » tcollection or tdynarray and select » 2014-09-05 15:45:51

lele9
Replies: 4

hi,
i have a tcollection/tdynarray property in a tsqlrecord object.
i would like to query(with a select statment) just the first element of tcollection/tdynarray.
It's possible? how?
thanks,
Emanuele.

#59 Re: mORMot 1 » TDynArray and RTTI? » 2014-08-29 16:06:35

i would like to exchange position at two element, but without know the type of element...so i can't use an helper variable...
for example when i know the record type, to shift up an element i do:
var myHelperVar: TMyRecordType;

myHelperVar := TmyRecordType(myDynArray.ElemPtr(Pos)^);
myDynArray.Delete(Pos);
myDynArray.Insert(Pos-1, myHelperVar);

there is a way to do without know the record type!?

#60 Re: mORMot 1 » TDynArray and RTTI? » 2014-08-29 15:31:00

thanks ab, im in the way, when i finish post the code for sharing.
another question about TDynArray:
there is a method to shift an element?
thanks

#61 Re: mORMot 1 » TDynArray and RTTI? » 2014-08-29 11:01:58

excuse me ab,
i see the code of RecordEquals in synCommons and seems iterate in the field of a record...with a parameter TypeInfo.
but i can pass to my generic procedure the typeinfo of the specific tdynarray.
what do you think?

#62 mORMot 1 » TDynArray and RTTI? » 2014-08-29 10:11:21

lele9
Replies: 7

Hi,
im playing with TDynArray (until now i use TCollection, but i would like use array of record in next project).
Can i iterate the field of a generic TDynArray and edit the value without know the type of my array of record?
Now i do this with TCollection to fill in a grid and to edit value without know the type of tCollectionItem.
Thanks

#63 Re: mORMot 1 » mormot and LiveBindings » 2014-08-18 13:26:50

ok, so a question...
if i would like to create my own user interface, how bind the object with component?
now i use a procedure to "bind" objetc and vcl similar at mormotUIEdit with "load" and "save" method but i think there are best method to do...?
anyone have other solution?
Model GUI Mediator pattern is a good solution? it can be implemented at framework level or mormot offer other way to do?
thanks

#64 Re: mORMot 1 » mormot and LiveBindings » 2014-08-15 14:56:28

thanks for your experience edwinsn!

what do you think about this way?
http://members.adug.org.au/2012/03/16/u … o-objects/

#65 Re: mORMot 1 » mormot and LiveBindings » 2014-08-14 07:24:25

hi ab,
when i meet mormot i forgot tclientdataset smile so i wont return to the past smile
now i use a procedure to "bind" objetc and vcl similar at your mormotUIEdit but im curious about livebindings potential (?!).

#66 mORMot 1 » mormot and LiveBindings » 2014-08-13 09:01:21

lele9
Replies: 9

Hi,
anyone have experience how to use livebindings with mormot?
im writing new small application and im curious to experiment livebindings.
Where to start?
bind an object is quite clear but i dont understand hot bind a TSQLTableJson or an array of record etc...
Any example?
Thanks in advance.

#67 Re: mORMot 1 » Save/restore file to/from database » 2014-04-07 16:05:31

I use TSQLRawBlob so save/restore pdf file and .fr3 file (report) using explicit call to updateBlobField without problem.
Which kind of file cause the problem?i can test in my application.

#68 Re: mORMot 1 » TSQLRecordMany alternatives » 2013-08-08 07:20:53

yes i understand what you mean but not all data can be put in one TSQLRecord class.
for i.e. in my case i need to join TMySQLRecordMany and TSQLAuthUser (many to many relationship) so i can't do what you mean!

But i can't use TSQLRecordMany with another TSQLRecordMany as Source, i can't use dynamic array, what i can use to implement this situation?

#69 mORMot 1 » TSQLRecordMany alternatives » 2013-08-07 17:08:37

lele9
Replies: 2

hi ab,
in referring to this problem http://synopse.info/forum/viewtopic.php?id=1378
where is the suggested way to avoid TSQLRecordMany?
i read the documentation about neested object dynArray, tCollection and so on but in all example you never use another TSQLRecord inside.

i.e.
can i use TDynArray of packet record where one property is a TSQLRecord?

thanks,
Emanuele

#70 Re: mORMot 1 » TSQLRecordMany as Source of another TSQLRecordMany » 2013-08-07 16:24:42

i do a simple test...no A/V errors but in Database i see that the table of TSQLRecordMany that contains as Source another TSQLRecordMany has NO SOURCE COLUMN so i can use but not persisting!
there is a solution?
thanks,
Emanuele

#71 mORMot 1 » trees structure » 2013-08-06 13:05:46

lele9
Replies: 6

hi,
there is some orm's feature or suggested way to implement a trees structure in mormot?

#72 mORMot 1 » TSQLRecordMany as Source of another TSQLRecordMany » 2013-08-05 08:47:16

lele9
Replies: 2

hi ab,
i can do TSQLRecordMany as Source property of another TSQLRecordMany or it is not recommended?
thanks,
Emanuele

#73 Re: mORMot 1 » tDateTime unexpected behaviour » 2013-08-01 07:41:47

thanks ab and esmondb!
the problem its TDateTimePicker so i make some test.
put TDateTimePicker on form and set kind property to dtkDate and Time property to null.
run the program.
all seems ok until i disable and re-enable the TDateTimePicker. In this case Time value is set to current time!
i work around with esmondb solution ---> trunc(TDateTimePicker.Date)
thanks again,
Emanuele

#74 Re: mORMot 1 » tDateTime unexpected behaviour » 2013-07-31 15:37:11

when i told that in database i find its because i'm looking with SQLite Database Browser too...

#75 Re: mORMot 1 » tDateTime unexpected behaviour » 2013-07-31 15:20:43

i assign date form tdatetimepicket like this

myTSQLRecord.myDateTime := myTDateTimePicker.Date;

why in database i find the time?

#76 Re: mORMot 1 » tDateTime unexpected behaviour » 2013-07-31 14:56:10

No, i have for example 'T11:08:10'

#78 Re: mORMot 1 » tDateTime unexpected behaviour » 2013-07-31 14:18:58

sorry, i explain wrong...

for TDateTimeField i mean a property of a TSQLRecord declared as TDateTime.

when i pass a Date value i find exactly the date i set (and only the date!)
when i pass a null Date (30 dec 1899) i find in database only the time (correctly dont save the date, but why the time???)

i hope that now the problem its clear.
thanks

#79 mORMot 1 » tDateTime unexpected behaviour » 2013-07-31 10:28:06

lele9
Replies: 15

hi,
i use a tdatetime for a tsqlrecord's property.
when i save just a tdate value in the database table i find correctly just the date value but if i save a null tdate value in the database table i find the time saved with timestamp.
i.e.

|TDateTimeField
|----------------
|2013-07-31                   <---- saved passing a tDate value
|T12:23:08                     <---- saved passing a null tDate value

why??
thanks,
Emanuele

#80 Re: mORMot 1 » createandfillprepare with a dinamic array of parameters » 2013-07-22 08:40:25

sorry but i cant pass an array variable to formatUTF8. Can u make an example please?

#82 mORMot 1 » createandfillprepare with a dinamic array of parameters » 2013-07-19 16:36:09

lele9
Replies: 5

hi,
i have used
TMySQLRecord.CreateAndFillPrepare(aClient, aSQLWhere, [const1, const2,..]);

now i would create my array of const dinamically (and decide which parameters pass) but when i write

TmyArray = Array of TVarRec;

myArray: TmyArray;

...

TMySQLRecord.CreateAndFillPrepare(aClient, aSQLWhere, myArray);

i have
[DCC Error] E2250 There is no overloaded version of 'CreateAndFillPrepare' that can be called with these arguments

maybe i lost in a glass of water...how can do this?
thanks

#83 Re: mORMot 1 » create a TObjectList from TSQLRecordMany » 2013-07-01 14:35:01

yes i know that it is not implemented yet, i would like to implement but i can't understand how read the TSQLRecordMany instance by RTTI!
i try

case aFieldType of
          sftDateTime: begin
            CD := TDateTimePicker.Create(Scroll);
            CD.Kind := dtkDate;
            CD.DateTime := Iso8601ToDateTime(aValue);
          end;
          sftTimeLog, sftModTime: begin
            CD := TDateTimePicker.Create(Scroll);
            CD.Kind := dtkDate;
            TimeLog.Value := GetInt64(pointer(aValue));
            CD.DateTime := TimeLog.ToDateTime;
          end;
          sftCreateTime:
            ; // is low-level read/only field by design
          sftBlob, sftMany:
           begin
               obj := TSQLRecordMany(Pointer(aValue)); //but aValue = ''!!!!! WHY??
           end;

thanks,
Emanuele

#84 Re: mORMot 1 » create a TObjectList from TSQLRecordMany » 2013-06-25 14:14:41

yes i know, but i would like to implement but i need some help.
for example:
i read in the documentation that TSQLRecordMany property of a TSQLRecord class is an instance but...
why aValue is empty? (aValue = '')

aValue := P.GetValue(aRecord,false);
aFieldType := Fields.List[i].SQLFieldType;
        case aFieldType of
          sftDateTime: begin
            CD := TDateTimePicker.Create(Scroll);
            CD.Kind := dtkDate;
            CD.DateTime := Iso8601ToDateTime(aValue);
          end;
          sftTimeLog, sftModTime: begin
            CD := TDateTimePicker.Create(Scroll);
            CD.Kind := dtkDate;
            TimeLog.Value := GetInt64(pointer(aValue));
            CD.DateTime := TimeLog.ToDateTime;
          end;
          sftCreateTime:
            ; // is low-level read/only field by design
          sftBlob, sftMany:
            ; // not implemented yet               <------------------WHY here aValue IS EMPTY??

can you help me to understand?

#85 Re: mORMot 1 » create a TObjectList from TSQLRecordMany » 2013-06-24 08:04:45

it's clear my situation and what i would like to do?
any idea?

#86 Re: mORMot 1 » create a TObjectList from TSQLRecordMany » 2013-06-21 15:04:13

ok, forget my code. i try to explain all situation.
i have a component that taken a tObjectList is able to show and elaborate it, so i would like to get a tObjectList from a generic TSQLRecordMany property.
now, think about mORMotUIEdit and his TRecordEditForm.SetRecord procedure.
Well, i would like to implement this part of code

sftBlob, sftMany:
            ; // not implemented yet

reading a tObjectList from TSQLRecordMany property and pass it to my component.

What is the correct and fast way to do?
thanks ab for the help!

#87 Re: mORMot 1 » create a TObjectList from TSQLRecordMany » 2013-06-21 14:26:02

if i have TSQLRecordMany published property is a real instance after TSQLRecord.create, its right?

#88 mORMot 1 » create a TObjectList from TSQLRecordMany » 2013-06-21 09:04:36

lele9
Replies: 9

hi,
i have a TSQLRecordMany descendant class.
i would like to have a method that can create a TObjectList of TSQLRecordMany.

Something like this

ObjectList := TObjectList<TSQLBaseMany>.Create;
ObjectList.OwnsObjects := True;
SQLBaseMany.FillMany(aClient, aSourceID);
while SQLBaseMany.FillOne do
begin
     ObjectList.Add(SQLBaseMany);
end;
Result := ObjectList;
FreeAndNil(SQLBaseMany);

But when i call the method for second time i get an AV on SQLBaseMany.FillOne. Can you help me to understand where i mistake?
Thanks,
Emanuele.

#89 Re: mORMot 1 » Return a selection of a view » 2013-06-03 08:12:32

sorry eraldo,
i don't understand...you need a method to do a select of view (where "view" is a database view) or you need a method to get an user's selection of record from a view (where "view" is V part in MVC)?

#90 Re: mORMot 1 » Return a selection of a view » 2013-06-01 07:15:56

hi,
i use a view base class with more overloaded methods that can return an array of selected ids/an array with all field values of selected rows/tobjectlist with all object selected etc etc...

#91 Re: mORMot 1 » TSQLModel - Managing dependencies » 2013-05-03 14:44:03

see MainDemo.
you can find that ab use TFileServer and TFileClient classes like your purpose.

#92 Re: mORMot 1 » Different permissions for each entity (TSQLRecord), is it possible? » 2013-05-03 14:34:43

I think you can do that with user with AuthGroup "Guest".

#93 Re: mORMot 1 » blob handling » 2013-04-26 10:43:35

thanks i see synfile main project and now i work with blob!

#94 mORMot 1 » blob handling » 2013-04-24 16:01:48

lele9
Replies: 3

Hi,
i have a TSQLRecord class with TSQLRawBlob field.
I would like to use this field to store a report (Fast Report file).
How i can read/write this field?
i search in the documentation but im little confused...an example can help me...
Thanks,
Emanuele.

#95 Re: mORMot 1 » tcollection property from rtti » 2012-12-27 09:58:29

i found solution.

myColl := pointer(GetOrdProp(MyObj,pointer(GetPropInfo(MyObj.ClassType, aProperty.Name))));

#96 Re: mORMot 1 » tcollection problem » 2012-12-27 09:45:12

sorry ab,
i found the problem. its in my code...now it work!
thanks

#97 mORMot 1 » tcollection problem » 2012-12-27 09:18:56

lele9
Replies: 1

hi ab,
i have a TSQLRecord descendant property of TCollection descendant type like this:

TRecapito = class (TCollectionItem)
   private
    FContatto: RawUTF8;
    FDescrizione: RawUTF8;
    FTipo: TTipoRecapito;
   published
    property Tipo: TTipoRecapito read FTipo write FTipo;
    property Descrizione: RawUTF8 index 100 read FDescrizione write FDescrizione;
    property Contatto: RawUTF8 index 100 read FContatto write FContatto;
   end;

TRecapiti = class (TCollection)
end;

TSQLPersona = class (TSQLBase)
   private
    ...
    FRecapiti: TRecapiti;
    ...
   public
    constructor Create; Override;
    destructor Destroy; Override;
   published
    ...
    property Recapiti: TRecapiti read FRecapiti write FRecapiti;
    ...
   end;

implementation


{ TSQLPersona }

constructor TSQLPersona.Create;
begin
   inherited;
   Self.FRecapiti := TRecapiti.Create(TRecapito);
end;

destructor TSQLPersona.Destroy;
begin
   FreeAndNil(Self.FRecapiti);
   inherited;
end;

now i update to last version of mormot and now Persona.Recapiti is always nil. Why?
Can you help me please?
Emanuele.

#99 mORMot 1 » tcollection property from rtti » 2012-12-24 12:23:55

lele9
Replies: 2

hi,
i have a tsqlRecord's property of TCollection descendant type.
I need to get this property value from rtti.
How can i do?
Thanks,
Emanuele.

Board footer

Powered by FluxBB