You are not logged in.
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.
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.
great work ab!
do you think is possible the same structure for desktop application?
thanks ab and warleyalex for your suggest.
i think fmx with xe7 is a good solution for me. any working example?
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.
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.
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?
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.
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!?
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
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?
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
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
thanks for your experience edwinsn!
what do you think about this way?
http://members.adug.org.au/2012/03/16/u … o-objects/
hi ab,
when i meet mormot i forgot tclientdataset
so i wont return to the past ![]()
now i use a procedure to "bind" objetc and vcl similar at your mormotUIEdit but im curious about livebindings potential (?!).
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.
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.
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?
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
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
hi,
there is some orm's feature or suggested way to implement a trees structure in mormot?
hi ab,
i can do TSQLRecordMany as Source property of another TSQLRecordMany or it is not recommended?
thanks,
Emanuele
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
when i told that in database i find its because i'm looking with SQLite Database Browser too...
i assign date form tdatetimepicket like this
myTSQLRecord.myDateTime := myTDateTimePicker.Date;
why in database i find the time?
No, i have for example 'T11:08:10'
SQLite
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
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
sorry but i cant pass an array variable to formatUTF8. Can u make an example please?
hi ab,
which methods the orm offer to do this?
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
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
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?
it's clear my situation and what i would like to do?
any idea?
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 yetreading 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!
if i have TSQLRecordMany published property is a real instance after TSQLRecord.create, its right?
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.
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)?
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...
see MainDemo.
you can find that ab use TFileServer and TFileClient classes like your purpose.
I think you can do that with user with AuthGroup "Guest".
thanks i see synfile main project and now i work with blob!
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.
i found solution.
myColl := pointer(GetOrdProp(MyObj,pointer(GetPropInfo(MyObj.ClassType, aProperty.Name))));
sorry ab,
i found the problem. its in my code...now it work!
thanks
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.
any suggestion?
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.
its the only solution?