176

(16 replies, posted in Script)

PM, I'm a little confused, in your database you have just the one field - file.


So, will you be searching using just the file name or is there going to be some other column such as person name or person number?

177

(5 replies, posted in General)

V_pozidis,


You mention that A1 is a boolean, did you declare Y as a boolean also?

178

(16 replies, posted in Script)

Does the attached project help?

It is very basic and as it stands you can click on the table grid and get the link to open even with out entering a reference number.  if you enter number 1,2 or 3 into the search box it will automatically display just that entry.

However that can be fixed.

If you didn't want to see the actual link you can just not show that column and change the column number in the script to 1


I've just realised I've done it as a single click, all you need to do is copy the code to the double click event and delete the single click procedure.

179

(187 replies, posted in General)

Here is the code I use.  Windows will automatically open the registered application according to file type. Amend to your own circumstances.


To open a file displayed in a tablegrid by double clicking  on a row.

procedure frmMain_tgDatasheets_OnCellDoubleClick (Sender: TObject; ACol, ARow: Integer);
var
  fName :string;
begin
  fName := SQLExecute('SELECT DISTINCT datasheetFile_Filename FROM Datasheets WHERE id = '+frmMain.tgDatasheets.SQLValue);
  OpenFile(fName); 
end;

If you are using a tablegrid to display the database entries, then just set that up using the standard tablegrid wizard in VDB.


I've attached an image of my program displaying two rows of information. Clicking on either of them will open a different document. One is a PDF and the other is a text item.

180

(16 replies, posted in Script)

What is or isn't the above code doing for you?


Could you either provide and example of your script or better still an example of your project.


You did change my form and component names to your names?

181

(4 replies, posted in Russian)

I think you could test for the directory first;

Я думаю, вы могли бы сначала проверить каталог;

DirectoryExists(const Directory: string):boolean

begin
    sl := TStringList.Create;

    if DirectoryExists('имя каталога') := true;

          sl.Text := GetFilesList(path);
          
 остальная часть вашего кода выше
    else
        show message('Каталог ошибок не существует');
    end;
end;
      

Using Google translate

Without knowing exactly what you are doing my thoughts are:


Check the date(now) with the preset date. 


IF date(now) is  > than preset date  THEN
  component.visible := false; 


Component can be tablegrid, button etc.


To disable a component write


component.enabled := false;


or


ShowMessage('Date has expired');

183

(16 replies, posted in Script)

In answer to your last question PM, that is quite easy to do.


Below I'm using a label to display a URL on a form and the label has got the URL from a database field. I then click on the label to open a webpage.

procedure frmMain_lbWebpage_OnClick (Sender: TObject);
var
    webpage:string = 'http://www.mywebsite.com/'; {assign fixed text to a string}
begin
  
  webpage := webpage + frmMain.lbWebpage.Caption; { add the database information to the existing string}
  OpenURL(webpage); 
end;

Obviously you don't have to use a display label as I have, you could just use another string variable to contain the database information or a hidden text box.

frmMain.lbWebpage.Caption := sqlexecute('SELECT suppliers.webpage FROM suppliers where id =' +frmMain.tgSuppliers.sqlvalue);

Substitute frmMain.lbWebPage.Caption with a local string variable if you wish.


There are a few variations on the way you could use variables and or constants to this theme.

184

(4 replies, posted in General)

You could always just change the file type extension by manually changing  somename.exe to somename.xyz  the spam and virus checkers may then ignore the file. Of course you'll need to send instructions telling the recipient to change the file extension back to exe.


Don't forget that email has a maximum file size of around 8 to 10MB for external emails and zipping actually increases the file size from the email system point of view.

185

(3 replies, posted in General)

Just some further info, if you wish you can add components to the  login form by creating them in script.

Below is an example on how to do that using a logo I downloaded from a royalty free site for my project.

{This needs to be global as we don't have direct access to the form}
var
 lbAcknowledge : TLabel;  // or some other component

begin
 ~~~~~~~~~  other code that you may have here
~~~~~~~~~~

   lbAcknowledge := TLabel.Create(frmdbCoreLogin);
   lbAcknowledge.Left := 113;
   lbAcknowledge.Top := 170;
   lbAcknowledge.Width := 300;
   lbAcknowledge.Height:= 15;
   lbAcknowledge.Parent := frmdbCoreLogin;
   lbAcknowledge.Wordwrap := True;
   lbAcknowledge.Caption := 'your label caption here';
   lbAcknowledge.Visible := True;

~~~~~~~~~ other code you may have
end.

186

(2 replies, posted in Script)

I think you need to change


cb.ItemsChecked[i]



to

cb.ItemIndex[i]

As this will return only the selected items.

Я не думаю, что у вас получится, я считаю, что вам придется создать свой собственный. См. Https://vk.com/@createmyvisualdatabaseapp-nachalnyi-uroven для некоторых идей.

Использование Google Translate


I don't think you can, I believe you will have to create your own. See https://vk.com/@createmyvisualdatabasea … nyi-uroven for some ideas.

Using Google Translate

188

(1 replies, posted in General)

I have discovered the answer!  - MVD does not work with  authentication type "caching_sha2_password"  only with the older style "standard" authentication.

189

(1 replies, posted in General)

I have MySQL version 8.0.21 and the server is running. 


When I try via the Connect wizard in MVD to find and connect to a database I get the MySQL error "#08004 Client does not support authentication protocol".

I'm using  Localhost, port 3306, user = root and password = my_password and yet I keep getting a connection error.

I've reset my password but that makes no difference. MySQL is functioning as I have created and used a couple of databases with Workbench.


What might I be missing?

190

(1 replies, posted in General)

I have just had one further thought, perhaps I only need to have the database on the shared drive and the users have their own copy of the program pointing to the single database in WAL mode.


Currently I have the program and the database in the same directory basically duplicating my development environment.

191

(1 replies, posted in General)

I realise this might be outside the scope of general questions here, but if there is a general database expert their thoughts would be greatly appreciated.


My Sqlite database using MVD is almost ready for use, however the environment in which it is going to be used has just had its IT department increase security on a mapped shared drive.  This has caused my little program to break even with WAL enabled. Some people can access it and others get a disk IO error or database locked messages. Eventually everything falls over for everyone.


I believe the reason this has suddenly started happening (my previous testing didn't have this problem) is due to the mapped drive being not only cached but the cache also gets wiped at regular intervals.


I am not in a position to alter any of this, so I'm wondering if I put the SQLite database into in-memory mode would this possibly solve my problem? I'm assuming that in-memory mode will create an in-memory database on the users PC and that behind the scenes transactions occur that allow the writes to be persisted back to the on-disk DB.


1. Does this sound correct?
2. Can MVD work with a Sqlite DB in - in- memory mode?
3. Is there another way around this? 

Note using MySQL isn't an option, as I can't install MySQL server (or any software that requires accessing registry) on either my work PC or the mapped drive.


If none of the above is possible I'll have to install my program on a non networked PC and just have multiple users use it one at a time.


Any solutions or suggestions gratefully received.

reteinformatica wrote:

È scritto in russo smile In ogni caso la documentazione (in inglese) già l'ho letta tutta.

Use Google translate or if you are using Firefox enable the auto page translating add-on.



Here is what my browser translates the link to.


About the program
My Visual Database allows you to quickly develop a database application. It can be like a simple telephone directory, or a system for accounting in your business. This program simplifies the development of such applications as much as possible, hiding all the complexity of working with databases, while leaving the opportunity for direct interaction with data, if necessary.

After starting the program, you can immediately start developing your application. There is no need to install anything extra and configure it.

The result of your work will be a standalone application that does not require the installation of My Visual Database or any other components. Just transfer the entire folder with your application to any other computer and run.

By default, the application you create uses a fairly simple yet robust SQLite database. Typically, SQLite is designed for single-user work, but multi-user work on a local network through a shared folder is also allowed.

If necessary, your application can use the MySQL database. This database is multi-user and is perfect for working over the Internet.

For advanced users and programmers, scripts (Object Pascal) are provided, with many built-in functions and classes that will allow you to implement any functionality of your future application.

193

(12 replies, posted in General)

I get the feeling that the two things are going hand-in-hand, that is the new documentation and the new version.  If you want to see what is going on with the new documentation, then there is a link in the Russian language section to the initial offering.

It is in Russian, but if your browser has the 'translate a page ' facility it is readable. It certainly is fine when translated into English.

http://myvisualdatabase.com/doc_ru/Newtopic.html

194

(2 replies, posted in General)

There are a couple of ways to fix the column widths.

1.  In the onShow event of a form you could write the following for each of your columns

Form1.TableGrid1.Columns[0].Width := 30;


You could alternatively use

Form1.TableGrid1.BestFitColumns(bfBoth);

This adjusts the columns and header to automatically fit the contents, so this is dynamic as it will change depending on the data width.


There is a third option, which is very long and laborious and really shouldn't be used, which is to manually enter your column widths into the forms.xml file. This is a BAD IDEA manually altering the XML file can result in MVD not starting. I'd go for options 1 or 2 above.

Is it possible to access the password form directly in MVD 6.3?

I know I can access both the user and users forms by  using the following code:


frmdbCoreUsers.ShowModal; and frmdbCoreUserForm.ShowModal; .


My reason is that I would like to access them via  role enabled buttons.

If it is possible, rather than reinventing the wheel, I'd like to generate an initial password whenever a new user is added.

I intend to leverage part of the the code written by K245 from his MVD course.

If it isn't possible to access the password form, then obviously I'd roll my own form and code.

Thanks Brian,


It still doesn't work in my project, so I'm going to disable the Delete property and write my own handler.


I've done that elsewhere creating a right click on a button to delete a record.

197

(1 replies, posted in General)

You can't directly, only MySql and SQLite.


I don't think even with a script you can write an adapter to access Firebird as there is no access to the behind the scenes Delphi that MVD is based on.


Unless you can find a program that perhaps either accesses Firebird and allows a MySql or SQLite conversion or uses the Microsoft ODBC adapter.

I have decided to allow an end user to delete an item from a tablegrid  by right clicking and selecting 'delete'. This is purely because my survey of end users were concerned about using a  button to delete the entry and they felt it safer to deliberately highlight an entry and then right click.

I need to place formX.tablegridX.dbUpdate  somewhere.


My problems are:


1. I would like to update this table grid to reflect the new data result - currently it refreshes but without the data filtered.


2. I would like to update a different table grid to reflect the deletion of this item.


I can't fathom how to update either table grid to reflect automatically the new data after using the context menu.


I've tried the following events for the 'delete' table grid:


OnChange - this does nothing in this context.
OnAfterEdit -  ditto
OnMouseUp - ditto


Obviously once I know what event the right click delete option can trigger I can then reload the delete table grid with the filtered data rather than the complete database.


Is there a way perhaps I could have the right click delete menu, trigger a hidden button action which I could use to reload both tablegrids?


Does anyone have a solution?


PS: I should add the right click delete option is via the tablegrid properties in th eobject inspecter and AllowDelete = True

Hi glkonst79,


Не могли бы вы прикрепить свой проект, чтобы мы могли увидеть, в чем может быть ваша проблема.

Could you attach your project, so that we can see where your problem may be.

Переведено с помощью Google Translate

200

(27 replies, posted in General)

Well thanks Derek,  I hadn't thought of doing it that way, mainly because I was going to write it in the script and suddenly thought, maybe I can use MVD to save me some typing.


I'll try using the SEARCH function and see if that produces the result I need.