1

(4 replies, posted in Script)

sibprogsistem wrote:

try like this

thanks a lot . I think all  my questions have been solved.

2

(4 replies, posted in Script)

Thanks a lot that the MVDB Team give me so great tool to record ,list ,analyse the data.I have developed two simple application for my work. when i am doing the development,i have some question,I also get the answer through the forum.
Now, there are 4 questions ,the detail information can be found in the attachment(there are 3 files).

1.why the second way cannot list the record with empty data?
2. how the set up the filter of tablegrid1
3 edit and delete the data
4 the auto-number

3

(3 replies, posted in Script)

Thanks ,the question has been solved

4

(3 replies, posted in Script)

hi,I have a question about combox
I creat a combox,then use the script to get the field of combox

frmmain.ComboBox1.dbSQLExecute('select item from table where id<=10');

so i can get 10 field of combox1.When I dropdown the combox1,the combox1 can show 10 field text, but i select one of field ,i cann't select the field  . plesase help me. thank you.

sparrow wrote:

form2.TableGrid1.dbSQL := 'select name,indate from maintable where indate >= date(''now'',''-30 day'')';

thank.it work well.

thank you!but i cann't run the app with this script.please help me

     form2.TableGrid1.dbSQL := 'select name,indate from maintable where indate >= date('now','-30 day')';
     form2.TableGrid1.dbSQLExecute;

I want to query the record that Days Between <=30days ,so I use the script ,but there is a error :NO such function DaysBetween.How can I use the function correctly?
form2.TableGrid1.dbSQL := ('select name,indate from maintable where  DaysBetween(now,indate)<=30 ')

8

(4 replies, posted in General)

thanks . i will try to us the  Forum 'search' function.if there is no answer , then i post the topic.

9

(4 replies, posted in General)

thank you for your help . i want to do it in script ,how to do this ?

please tell me how to setting  Alignmen of  tablegrid header.thanks

The problem have been solved, must select id ,*, from talbe

The ".AllowCreate" can work correctly, but the ".AllowEdit"\.AllowDelete \.SecondClickEdit  cann't work

There is my script,what's wrong with me?thanks

procedure frmmain_OnShow (Sender: TObject; Action: string);

      var

      GP : string ;

begin

     // show recorder by access

      GP := SQLExecute('select groupid from PASSWORD where number = ''' + Application.User.Username + '''');

      if SQLExecute('select role from password where number = '''+ Application.User.Username + '''') = 'admin' then

         frmmain.TableGrid1.dbSQL := 'select number,name,taskname,taskload,groupid from task '

      else if  SQLExecute('select role from password where number = '''+ Application.User.Username + '''') = 'leader' then

         frmmain.TableGrid1.dbSQL := 'select number,name,taskname,taskload,groupid from task where task.groupid = '''+ GP + ''''

      else

         frmmain.TableGrid1.dbSQL := 'select number,name,taskname,taskload ,groupid from task where number = '''+ Application.User.Username + '''';

         frmmain.TableGrid1.dbSQLExecute;


     //edit tablegrid

       frmmain.TableGrid1.AllowEdit := true;

       frmmain.TableGrid1.AllowDelete := true;

       frmmain.TableGrid1.SecondClickEdit := true;

       frmmain.TableGrid1.dbUpdate;


end;

I am wondering,sometimes I can edit the tablegrid,but sometimes i cann't .what's the matter?

in the script ,

select * from table where *

frmmian.talbegrid1.allowedit := true;
frmmain.TableGrid1.SecondClickEdit := true;

but i cann't edit the tablegrid .why

my example is in the attachment.

16

(4 replies, posted in General)

derek wrote:

Hi,
All of the MVD access controls (including the user name) are available.
These are accessed as follows:
Application.User.Username;
Application.User.Email;
Application.User.First_name;
Application.User.Last_name;
Application.User.Role;
Application.User.RoleId;
Application.User.is_admin;
Application.User.is_active;
Application.User.is_logged;
Application.User.Last_login;
Application.User.Date_joined;
Derek.

Thank you very much Derek.

17

(4 replies, posted in General)

How to get the user's name if I use the MVDB ACCESS CONTROL?

18

(4 replies, posted in General)

MVDB can develop an app like forum with these functions
1.user login by password
2.user only list and edit delete his data when he loginned
3.staff leader can list .edit delete approve  the  staff member's  data
4.admin can list all data
the staff  maybe divide into 3 groups,and the staff members is about 100 person.

19

(1 replies, posted in General)

The  calculated field is very useful for calculation,but  I know tha the field is not real field .So I use the tablegrid to show the result of calculation.there are two questions:
1.the calculated field can calculate another table field?
2.when showing on the tablegrid ,the recoder repeated, how can i get the only one recoder?

PunBB bbcode test

20

(3 replies, posted in General)

derek wrote:

Hi,
I think I'd use a calculated field to get the month that the birthdays occur in and then use that as a search criteria;  that way, you can see birthdays in any month and not just the current month.
Please see the attached as a suggestion.
Derek.

Thanks.Is there another way with script? I cann't find a function to doing this with script.

21

(3 replies, posted in General)

Is there a method to get the current month? for example, the field name is "birthday" and type is date, in the table list, i want to list that who's birthday in the current month.
thanks.

select (select count(*) from supinfo b where a.id >= b.id) as row_number,Number,name from supinfo as a order by id

when i do that 'select * from talbe',then show the result
id  number name
1    T001    Jack
2    T002    Sam
3     t003     Su
i do that 'select number,name from talbe where name like 's%'',then show the result
number name
   T002    Sam
   t003     Su
so, how to add Auto-number when finished the search by the script?
thanks.

24

(6 replies, posted in General)

one more question :how to creat a field named 'age' and get the someone age? thanks

25

(6 replies, posted in General)

Thanks for your answer. You understood very correctly!