26

(7 replies, posted in Script)

procedure Form1_Button1_OnClick (Sender: TObject; var Cancel: boolean);
begin
  Form1.LeftButton.Click;
  Form1.RightButton.Click;

  // It's the same for all buttons
  // When you click button 1 all those buttons will click too.  
  // Derek can give you a downloadable example.  Greetings
end;

thanks brother, exact solution for what I need.

Wen.

Hello again, is there a way to do this?
1- I want to cancel the insertion of a data to the database if it already exists (eg the identification number of the person, ID), that is, when I click on a save button if the data exists, I get a message  and do not insert this data because it is repeated.

I am using 6.5 version

29

(9 replies, posted in Script)

Hi, any suggestion from the community?

Hi everyone, How could I make a form refresh certain data every x seconds?  The situation is the following.  I have a dashboard (frm_dashboard) where I show important data and graphs, but I don't know how to refresh it automatically.  This could be done with a time object but there is not one here, how could it be implemented through code?

THANKS, WEN

31

(9 replies, posted in Script)

Hello community, I would like to validate some data (Email, DNI, date format) before saving them in the database. For this, do you know regular expressions but do not know how to use them, could you put some examples?

32

(7 replies, posted in Script)

Master, any idea why MVD 'now' returns a date and my computer gives me another?

33

(30 replies, posted in General)

Hi folks, I'm getting this error when I try to remove the "bold" property from the button.  Any idea of the problem?

Error: Invalid variant operation

frm1.button1.font.style := frm1.button1.font.style - [fsBold]

34

(7 replies, posted in Script)

Hello brother, a question out of the situation.  How can I use calculated fields in the "SQL Query" action of the buttons?  for example in a selection of data.  I get the error that the field has not been selected.

35

(7 replies, posted in Script)

And if I want to obtain in a grid the list of people who have their birthday this month, how do I do it?

36

(7 replies, posted in Script)

Thanks your brother, you are amazing

37

(7 replies, posted in Script)

Hello, I want to put in a calculated field the date of birth of the people from the ID, this is what I put, the query is supposedly fine but inside MDV it gives me an error.  There is something I'm doing wrong and I don't know what it is. I need help with this my people, TKS

select format (convert(datetime, Left(dni,6),11),'yyyy/MM/dd') from dat_person

38

(1 replies, posted in SQL queries)

I have a SQL statement on a calculated field that has a CASE of SELECT and I just can't get it right.  Let me explain better, I have a list of services that have a date range (start and end) I have a calculated field that if the current date is greater than the end date of the service then it takes the value (text) of "finished", if  is less then it takes the value of "In progress".  Could you help me with an example?

39

(5 replies, posted in General)

A person goes through multiple courses (years) at their school (eg 1st year, 2nd year, etc.), and in each course they receive multiple subjects. What I want is that depending on the course in which the person is, the subjects they received in that course appear on the grid.
Greetings, wenchester

40

(5 replies, posted in General)

Hi Derek, thanks first of all.

What I want to do is a little more complicated (I attach an example with a note in the form). There are 2 tables (people, subject) that have reference to another table (course). What I'm looking for is that in the grid of the people form, only the records associated with the course in question appear, and not all

41

(5 replies, posted in General)

Hi.
I would like to know if what I indicate in the image can be done?

The goal is for the grid content to change as the Combobox changes

42

(1 replies, posted in General)

Hello everyone.
Any idea how to make the objects in the form have a relative position depending on the size of the window.

43

(5 replies, posted in Script)

DriveSoft wrote:

Just attach your project, I'll test it.

When you try it you will see that it gives an error when saving the user, but that is not the error of which I speak, if you see that it can be, correct this new error

44

(5 replies, posted in Script)

DriveSoft wrote:

It should works. But I see some strange keyword "elseCndition"
Please attach your project, I will test it.

Those strange words that you see are a mistake, I'm going to remove them from the original post so there's no doubt.

45

(3 replies, posted in General)

Hello manix 2013
I do not know if it is what you are looking for but I leave you a little help that can help you. If what you are looking for is something else, comment and we help you ...

Regards Wen.

46

(5 replies, posted in Script)

In the action of clicking the "frmAddUser_btn_save" button, I declare some variables that auto followed assume their value of some objects of the "frmAddUser" form, others of an SQL query and other variables predefined in other methods.

A condition that has no complexity is also executed. The problem is the following:

When the variable "name_userVar" has value, everything works fine, when it is variable it has no value I skip the message I define but execute the SQL query that is inside the ELSE as well. This is what I do not want, I should not execute the SQL query.

var 
addtipoVarUS, passChangeVar  : String;
procedure frmAddUser_btn_save_OnClick (Sender: TObject; var Cancel: boolean);
var
userVar, nombre_userVar, readVar, writeVar, removeVar, searchVar, exportVar, printVar, dataVar, administratorVar, tipoVar : String;
fechaVar, tiempoVar : Extended;
begin
   writeVar := BoolToStr(frmAddUser.chbCreate.Checked);
   readVar := BoolToStr(frmAddUser.chbRead.Checked);
   removeVar := BoolToStr(frmAddUser.chbDelete.Checked);
   searchVar := BoolToStr(frmAddUser.chbSearch.Checked);
   exportVar := BoolToStr(frmAddUser.chbExport.Checked);
   printVar := BoolToStr(frmAddUser.chbPrint.Checked);
   dataVar := BoolToStr(frmAddUser.chbDatas.Checked);
   administratorVar := BoolToStr(frmAddUser.chbAdmin.Checked);

   userVar := SQLExecute('SELECT id FROM users WHERE (login = ''' + sUser + ''');');
   nombre_userVar := frmAddUser.edLogin.Text;
   tipoVar := addtipoVarUS;
   fechaVar := Now;
   tiempoVar := Time;

   if nombre_userVar = '' then
    begin
    ShowMessage('The "User" field can not be blank!!!');
    end else
    begin
    SQLExecute('INSERT INTO registros_user'+
               '(nombre_usuario, fecha, tiempo, tipo_registro, read, write, remove, search, export, print, data, administrator, pass, id_users) '+
               'VALUES("'+nombre_userVar+'","'+DateToStr(fechaVar)+'","'+TimeToStr(tiempoVar)+'","'+tipoVar+'","'+readVar+'","'+writeVar+'","'+removeVar+'","'+searchVar+'","'+exportVar+'","'+printVar+'","'+dataVar+'","'+administratorVar+'","'+passChangeVar+'","'+userVar+'")');
    UpdateDatabase('registros');
    UpdateDatabase('registros_user');
    end;
end;

Any idea of the problem ...

47

(5 replies, posted in General)

DriveSoft wrote:

No yet. What you reason to use postgresql?

It is free to pay, and better to partition large volumes of data. And I like it more ..., I think you should support it, it would lift MVD to the clouds

48

(5 replies, posted in General)

Hello DriverSoft
Do you plan to support postgresql?

The texts in the example are in Spanish.
Install a mysql server and import the "diprod.sql" file

If you wish, you can add some idea or improve something ..., of course, share it with everyone.

50

(2 replies, posted in General)

Hello everyone.

I am writing an INI file and I have a problem with a variable type, when I want text strings everything works, but saving integers is where the error jumps. Below I put the code

procedure frm_conf_conecct_btn_save_OnClick (Sender: string; Action: string);
var
    ini: TIniFile;
begin
    ini := TIniFile.Create(ExtractFilePath(Application.ExeName)+'conf-conection.ini');
    try
        ini.WriteString('Settings', 'Server', frm_conf_conecct.ed_server.Text);
        ini.WriteInteger ('Settings', 'Port', IntToStr(frm_conf_conecct.ed_port.Text));
        ini.WriteString('Settings', 'Username', frm_conf_conecct.ed_user.Text);
        ini.WriteString('Settings', 'Password', frm_conf_conecct.ed_password.Text);
        ini.WriteString('Settings', 'Database', frm_conf_conecct.ed_database.Text);
    finally
        ini.Free;
    end;
    frm_start.Show;
end;

ERROR (Incompatible types: Integer, String at 8:56)