351

(2 replies, posted in General)

Setting the field you want to sort in the Sort Combobox in the report action might solve your problem.

352

(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

(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.

354

(3 replies, posted in Reports)

This might help

355

(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

(4 replies, posted in Script)

You can only edit the script in there, but you can not compile it there

357

(3 replies, posted in Script)

rbknathan wrote:

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. smile I hope someone can give us any idea on it. Meanwhile, I gotta search on making this one work.

358

(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

(3 replies, posted in General)

You can give aliases using Report (SQL) or Report via script.

360

(10 replies, posted in SQL queries)

rbknathan wrote:

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

(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

(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

(1 replies, posted in General)

http://myvisualdatabase.com/forum/viewtopic.php?id=1805

364

(1 replies, posted in General)

Check all the anchor of your Grid from the Object inspector.

365

(4 replies, posted in SQL queries)

Form1.Tablegrid1.dbSQL := 'SELECT `date`,`items`,`value` FROM `sales`';
Form1.TableGrid1.dbSQLExecute;

366

(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

(1 replies, posted in General)

No, you must do some code in it.

368

(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

(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

(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

(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

(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

(1 replies, posted in General)

This might help.

http://myvisualdatabase.com/forum/viewtopic.php?id=4396

Check for Show Record Buttons. You might duplicated your Show Record Button pointing to your Grid.

375

(4 replies, posted in General)

sibprogsistem wrote:

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.