Lainkes
Members-
Content Count
72 -
Joined
-
Last visited
Everything posted by Lainkes
-
Hello, I have a database with a lot of fields. There can have the value True of False. Now I want to count the number of records with True values per Field. I can do this per field. But then I have more than 50 SQL statements. SQL.Text := 'select count(*) from tablename where FIELDNAME1 = :FIELDVALUE1 '; ParamByName('FIELDVALUE1').AsString := 'True'; I was wondering if there could be a faster way to retrieve these in one SQL statement. Or is the way I'm working acceptable? Thanks for your advise. Lainkes
-
I'm using MariaDB. I have 1 table. In that table are 50 fields (string) that can be True or False. I want a count of the True value for every field for a particular year. I thought that SUM was adding values, not counting. Am I correct? Thanks for your feedback Lainkes
-
Hello, I have an inputmask (maskedit component). A part of the mask is the curreny year. So now users need to type the year. Is there a way to put the current year already in the mask? Thanks Lainkes
-
Hello, If the users want to change from date to month and year, they need to use the arrow keys. Would it be possible that the change goed automatically? When a user puts in a date, that the focus goes automatically to the month. And when entering the month, that the focus goes to the year part. Thanks for your feedback Lainkes
-
Hello, I'm new to FMX programming. I want to create a simple android app. I need to give in a name, a number, take a picture and sent it to a specific e-mail address. How can I access the camera and take that picture? That will be the first step. After that the question will be how to sent it all to an e-mail address. Thanks for guiding me Lainkes
-
Thanks for the info. Maybe stupid question, but how can I test the app without having a smartphone (android) connected to my computer?
-
Create action for different components
Lainkes posted a topic in Algorithms, Data Structures and Class Design
Hello, I have several DateTimePicker components. At the start, I set these to an empty value. When I click on one of these components, I want to execute the following code : TDateTimePicker(Sender).Format := Formatsettings.ShortDateFormat; If this is executed, the selected date is displayed. If not, it seems to stay empty. I wrote a little procedure, with this code. How can I like this to every component. I tried to link it to the 'onChange' event, but it's not listed. Thanks for your advice. Greetings Lainkes -
Create action for different components
Lainkes replied to Lainkes's topic in Algorithms, Data Structures and Class Design
I have a checkbox, a some other components on a line. Those components are disabled at the start. This is repeated several times. If a user clicks a checkbox (enabled), some components on the same line are enabled and my code is executed. Then a date can be selected and can be saved to the database. If a user clicks a checkbox (disabled), some components on the same line are disabled and the value of the DateTimePicker is set to an empty value . At the start of the program, the DateTimePicker components are empty, so no values are written to the databasse when no checkbox are enabled. Maybe there is a better solution for this problem. Greetings Lainkes -
Good morning, I read the information from an ID card into my form. I have all the info, and also a TImage component with the picture. Now I want to save the content of this TImage component to my database (mysql - firedac - blob field). What is the best way to do this? And how can I read the blob field, so that the image can be displayed again in another form? Many thanks Lainkes
-
This works fine. Many thanks. Sometimes I wonder where you guys find all this information.
-
Hello, I'm taking this up again. I was wondering what I need to use in FireDac to replace the TADOBlobStream command. For this code : StmPhoto := TADOBlobStream.Create(Q.Query.FieldByName('Photo') as TBlobField, bmRead); I'm still trying to read the image from my Blob field in to my TImage component. Thanks
-
Hello, I want to make a GroupBox component, and there I need DBCheckboxes. But I want that the user can select only checkbox. In general I want to copy the checkbox behaviour, since there is no DBRadiobutton component. I use this for reporting purpose. At the end, I just count the number of True values in a field to have a statistic. With a DBRadiogroup, I get the value of the selected radiobutton. But that's not what I need. Is that possible with the standard components? Or are there some components on the net that I can use? Thanks for your answer.
-
If I call the form, all DBCheckbox components should be unchecked. I tried to loop through all the components, but it does not help. Maybe I did that not in a correct way.
-
It does not work. To be complete, the checkboxes are on a groupbox component, and these are on a pagecontrol component. I set the ActiveControl property of the form to the Save button of the form.
-
I have a question. When I start my program, there is always one of the DBCheckboxes that is active. How can I disable that. So that by default no value is selected. Thanks
-
Hello, I have a DBGrid with records. On column contains a True of False value. Now I want this to be changed into a green icon (True) of red icon (False). And when clicking on the icon, it must be changed from T to F or F to T. Any idea how I can achieve this? Thanks Lainkes
-
I restarted the Delphi program, and now your first code seems to work. The selected checkbox has True, all the other fields are NULL. So that's a very good way to work. Many thanks for this solution.
-
Good morning. When changing the code I get an access violation error. I guess it has to do with the change of code. Any idea what is going wrong? Many thanks
-
Copying character to string problem
Lainkes posted a topic in Algorithms, Data Structures and Class Design
Hello, I have this code procedure Tfrm_langauge.Button1Click(Sender: TObject); var I: Integer; dirtystr, cleanstr : string; begin cleanstr := ''; dirtystr := '123456'; for I := 0 to dirtystr.Length - 1 do cleanstr := cleanstr + dirtystr[I]; end; For some reason, the cleanstr string is always empty. Any idea what is going wrong. I'm sure it's something stupid. The purpose is to remove all characters except numbers for a string. I check the character and if it is a number, I add it to my new string. When I tested that function, it returned always an empty string. That's why I did this little test with the above code, with the same result. Thanks for your help Lainkes -
Thanks for the code. This seems to work like I wanted. The only problem is that all the fields are getting the value True when saving the record. I linked all the components to the same event. Maybe that's not the correct way to handle.
-
That's indeed my problem. So I guess it's not possible to create that.
-
Let's say I have 5 fields in my table. I want to link each of them to a DBCheckbox component (in a TGroupbox). But only one can be checked. So the behavour is Radiobuttons. So for every record in my table 4 of the 5 fields have the value False, and 1 value is True. At the end, I can do a count of the number of True values of each field. Using if statements can be a solution, but that's not clean in my opinion. I have some groups where I can chose between 20 choices.
-
Copying character to string problem
Lainkes replied to Lainkes's topic in Algorithms, Data Structures and Class Design
Thanks. This worked. I thought that a string was an array of characters. And an array starts at position 0. -
Hello, I have a lot of TCheckBox components. Now I want to change them all to TDBCheckBox components. Is just changing the type in my TForm class enough? Or do I need to do more? Thanks for your feedback Lainkes
-
Thanks. This seems to work. Lainkes