Setting the field you want to sort in the Sort Combobox in the report action might solve your problem.
352 2020-08-21 14:00:33
Re: SQL Injection Prevention (6 replies, posted in SQL queries)
I think there's no parameterized sql statements. you can do escape_special_characters instead.
I hope they incorporate TSQLQuery later on.
For the other 2 questions. they will both not do anything harmful in your database. when logging in or if you try to fill it on your forms. They will be considered as text or numbers by the system.
353 2020-08-19 18:39:47
Re: need help for displaying data (5 replies, posted in Script)
Secondly, I can I get other field of other table in same same statement.
To include other field/s from other table, you can use join statement.
355 2020-08-19 13:40:46
Re: Type not found in IDE (4 replies, posted in Script)
In my analysis, you have to include TdbCombobox component in the script for you to access its properties. It is a bunch of codes to include classes, etc in Pascal and it is done by MVD.
356 2020-08-19 06:26:20
Re: Type not found in IDE (4 replies, posted in Script)
You can only edit the script in there, but you can not compile it there
357 2020-08-19 06:05:29
Re: Splitting the script file (3 replies, posted in Script)
Thank you brian.zaballa.
It worked. :-)
While searching about this, I came across the 'Unit' Concept.
https://wiki.freepascal.org/Unit
Unit approach is not working. Is it supported ?
Haven't tried this yet but it seems interesting. I need that one. I'm novice when it comes to pascal. I hope someone can give us any idea on it. Meanwhile, I gotta search on making this one work.
358 2020-08-19 05:31:47
Re: Splitting the script file (3 replies, posted in Script)
Just add begin end on the last part of your external pas (form1.pas and common.pas)
procedure HelloWorld (s: string);
begin
ShowMessage(s);
end;
begin
end.
359 2020-08-18 02:26:00
Re: Fast Report Field Names (3 replies, posted in General)
You can give aliases using Report (SQL) or Report via script.
360 2020-08-17 04:34:06
Re: SQL query working outside but no in MVD (10 replies, posted in SQL queries)
First of all my Thanks to derek, thezimguy, sibprogsistem, brian.zaballa, ehwagner for you suggestions.
@brian.zaballa - Updating the latest sqlite3.dll in the MVD installtion directory worked like a charm. Now, its allowing me to use all the latest sqllite in-built fucntions. Initially I replaced sqlite3.dll in the project folder and tried. That's why it was not working.
@ehwagner - I was trying to use the ROWNUM() function as an id attribute for dropdown. Your approach by having a intermediate table is also good. In the project you have attached why the drop down field is showing blank after choosing an item ? How to hold the selection ?
You're welcome. @thezimguy already said it tho "Just update the default sqlite3.dll that came with MVD to the current version and it will work. I tried to attach the current sqlite3.dll but upload was refused.". I just elaborated it with an image. I just think you overlooked it because it happened to me when i was trying sqlcipher to work. Cheers!
As for @ehwagner's code. You can replace the code in line 17 with
form1.ComboBox2.dbSQLExecute('Select id, (id||" - "||TableName) as val from MyTables');
Anyway, I think you don't need the first combobox approach. You can also use this to minimize the code.
SqlExecute('Delete From MyTables');
SqlExecute('Insert Into MyTables (id,TableName) select ROW_NUMBER() OVER (ORDER BY name) as id, sm.name from sqlite_master sm where sm.name <> "sqlite_sequence" AND sm.name <> "MyTables" order by sm.name');
form1.ComboBox2.dbSQLExecute('Select id, (id||" - "||TableName) as val from MyTables');
361 2020-08-16 12:07:23
Re: SQL query working outside but no in MVD (10 replies, posted in SQL queries)
Code's working fine with me after downloading the 32bit sqlite 3.
You must replace sqlite3.dll on the mvd folder and not on your project folder. Compiling your application will automatically replaced by the dll from mvd folder.
362 2020-08-16 11:47:29
Re: SQL Condition (1 replies, posted in General)
did you try the try except?
try
db_settings:=...
Conn.Open...
{query to get}
res.Open...
except
// your message here
end;
363 2020-08-15 14:27:09
Re: Mysql Connect Form (1 replies, posted in General)
364 2020-08-12 07:07:50
Re: Responship Tablegrid (1 replies, posted in General)
Check all the anchor of your Grid from the Object inspector.
365 2020-08-10 15:16:17
Re: show data on tablegrid (4 replies, posted in SQL queries)
Form1.Tablegrid1.dbSQL := 'SELECT `date`,`items`,`value` FROM `sales`';
Form1.TableGrid1.dbSQLExecute;
366 2020-08-10 15:11:18
Re: Multiple Foregin key to same Table (2 replies, posted in General)
There's no option to that for now. I hope MVD DevTeam can add this feature too. I'm looking forward to it too.
367 2020-08-10 15:06:52
Re: Save Combo box text to database (1 replies, posted in General)
No, you must do some code in it.
368 2020-08-10 14:47:56
Re: need help for displaying data (5 replies, posted in Script)
Yes it is possible to load data via script but why would you want to load it via script when you can load data on the Settings of the tablegrid1? Another option is to load data using search button with corresponding filters.
Here's a sample snippet of populating grid via script.
Form1.Tablegrid1.dbSQL := 'SELECT `date`,`items`,`value` FROM `sales`';
Form1.TableGrid1.dbSQLExecute;
369 2020-08-10 14:13:08
Re: MVD not seeing code (1 replies, posted in Script)
I want to see your code. I'm using this method of including files. Maybe something's wrong with your script if all procedures and functions included in the external files are working but the one button procedure.
370 2020-08-10 05:50:25
Re: MySQL Transaction (2 replies, posted in General)
Just use the Transaction statement START TRANSACTION and COMMIT e.g
try
SQLExecute('START TRANSACTION');
...
...
...
SQLExecute('COMMIT');
except
SQLExecute('ROLLBACK');
end;
It will depend on how your script works or how you want it to work. You may want to add START TRANSACTION statement on the OnClick Procedure of the button, then the COMMIT on the AfterClick Procedure. You can attach some project here, what you want to do with Transaction and someone will give you workarounds. Cheers.
371 2020-08-08 05:35:53
Topic: Run UpdateDatabase Manually (7 replies, posted in General)
Hello MVD Wizards.
Is it possible to disable UpdateDatabase('') function to run background, I mean when the system starts?
I want to run it manually after showing my Main Form for having bulk data makes login form to show very late.
I done it on mysql using the disable_connectdialog but how can I do such thing on sqlite?
Thank you in advance.
372 2020-08-06 18:07:35
Topic: ON DELETE SET NULL (0 replies, posted in General)
Good Day MVD Dev.
Can you add an option for the On Delete Set Null Constraint next to the Cascade Option on the relationship on your next update?
Doing this on script for now. I'm having problem setting it directly to the database for changing some fields on the table from MVD will reset the constraint I've made from my table.
Thank you in advance.
373 2020-07-03 00:07:36
Re: Automatic resize picture when stored in record (1 replies, posted in General)
This might help.
374 2020-07-01 08:32:14
Re: Double Click on Grid leads to show multiple edit forms (3 replies, posted in General)
Check for Show Record Buttons. You might duplicated your Show Record Button pointing to your Grid.
375 2020-06-01 00:51:53
Re: What else should be included with .exe? (4 replies, posted in General)
everything except files :
PhoneBook.vdb
Script/script.dcu
It's everything except:
PhoneBook.vdb
Script/script.pas
As per JB, .pas must be the one that is excluded for it is your source code. In addition,
only the compiled version is useful to him
also, any user with knowledge to programming can manipulate your application if you include your source code.