I created a sample project

I found some bugs with Rich Text Editor in MVD Version 5.0

1. When you have two or more RichEdit boxes in the same window and you paste content to RichEdit2, the content is pasted on RichEdit1 instead. 

2. Visible option on the property menu for RichEdit does not work. If you add code in the script section to hide the RichEdit it will work.

See attach image for more info.

28

(1 replies, posted in Script)

Anyone knows the code to save and retrieve rich format files to the database?

29

(20 replies, posted in General)

Here is the issue.. while using MySQL as the database, when I'm saving Rich Text and there is a large image embedded I get an error message saying "#200 Data to long for Column" this only happens in MySQL though with SQLite there is no problem. So, I started doing some troubleshooting, I went to MySQL database settings and change the Field from "Text" to "LongText" and this worked but MVD does not support Long Text so if I make a change to the database in MVD the field is reset and data gets corrupted.  [see attached image] for more info. Hope this helps.


Again this only happens when RFT has images using MySQL as the database. I also notice that is slow when saving RTF to MySQL with large images with SQLite as the database is a lot faster not even noticeable.

[see attached image]

30

(20 replies, posted in General)

Thank you Dmitry,
also, are you planning database support for Long Text? currently Rich Text reduces the size of the field big time, specially if you have images.  Or is there another way of storing big text for RTF in a database?

31

(3 replies, posted in Script)

Thanks alot derek... this worked..

32

(20 replies, posted in General)

Thank you jean.brezhonek but I don't want to disable the entire ToolBar just the 3 icons. 
Or maybe making this 3 icons into a separate ToolBar that will be even better.

also, is there a way to add support for MYSQL LongText field. Rich Text reduces the size of the field tremendously.

33

(3 replies, posted in Script)

How do you copy the Rich Text box to another Rich Text Box.  I have the following code but this only copies the text.


procedure Expand (sender: string; Action: string);
begin
  //copy rich text
  Form2.RichEdit1.text := Form1.RichEdit1.Text;
  //show window
  Form2.ShowModal;
end;

34

(20 replies, posted in General)

Hello,
This is awesome, so many possibilities... Is there a way to hide the New Page, Open and Save icon from the ToolBar1.  It's a little confusing when saving to the database.

35

(3 replies, posted in General)

This worked. Thank you very much.

I have another question. is there  a way to prevent the application from freezing while performing a task?

For example, I'm trying to run a query at the same time display the GIF animation advising the user to wait. But i notice that sometimes the application will freeze (including the gif animation) until the task is completed.  Can you help?

36

(3 replies, posted in General)

Hello, I have the following script to load a GIF image but for some reason the image is not loading.  No error messages just the image doesn't load.

Please Help.

procedure frm_main_OnShow (Sender: String; Action: string);
var gif: TGIFImage;
var    ImageList: TImageList;
begin
     gif:=TGIFImage.Create();
     gif.LoadFromFile(ExtractFilePath(Application.ExeName)+'Images\gif.gif');
     gif.Width:=200;
     gif.Height:=200;
     gif.Animate:=True;
     gif.AnimationSpeed := 500;
     frm_main.Panel1.Canvas.Draw(0,0,gif);
     gif.free;
end;

37

(5 replies, posted in General)

Can you provide an example for  Form: MinimizeToTray? I'm not able to find it on version 4.4 or 4.5.

I downloaded the sample code  "Google Maps database Polygons and Polylines.zip" and i'm getting the following error message  Undeclared Identifier: 'GetModifiedMapPolyline' at 89:49 i'm running version 4.4.


https://image.ibb.co/eZ0sDJ/image.png

39

(4 replies, posted in General)

wow!! this works.. thanks.

40

(4 replies, posted in General)

is there a way to hide the border of the TBitBtn button?  I just want to show the image, I'm trying to make the button look like a menu icon so that when ever hover to the image the image will be highlighted. Or do you have another way of doing this? Please Advise.

DriveSoft wrote:

TBitBtn class don't have option for that, only TButton class.

yes, I will like to have a way to pass some variables between two running programs.  Writing to the hard drive is a slow process, using memory will be a lot faster.

42

(4 replies, posted in General)

I need to change the button style using Script from bsPushButton to bsCommandLink need your help with the following code.

var  myButton : TBitBtn;
var  myImage: TPNGImage;


begin
    myButton := TBitBtn.Create(Form1);
    myImage := TPNGImage.Create;

    try
        myButton.Parent := Form1;
        myButton.Left := 5;
        myButton.Top := 5;
        myButton.Width := 35;
        myButton.height := 35;
        myButton.Hint:='Folder';
        myButton.ShowHint:= True;

        myButton.Style:= 0;        {<---- need to change to bsCommandLink }

        myImage.LoadFromFile('Images\folder.png');

        myButton.Glyph.Width := 30;
        myButton.Glyph.height := 30;
        myButton.Layout := blGlyphTop;
        myButton.Margin := 0;
        myButton.Spacing := 0;
        myButton.Glyph.Canvas.Draw(0,0,myImage);

    finally
        myImage.Free;

    end;
end.

Anyone has an example of Tstream??

Hello, I'm trying to work on a project where I have two running applications and I want both apps to be able to communicate with each other. For example Program A runs and calls Program B with some parameters. Program B processes the parameters and saves the output to text file. Program A then opens the output file and reads the data.  This process works but there is a big delay when saving and reading from the output file. I want to speed up the process, maybe using TMemoryStream  or  TStream to save a variable from one program to other or is there another way? Also I'm not using any databases for these two programs. Any help will be appreciated it. Thanks.

Hello "My Visual Database" fans and users. I just wanted to say that I love this application because its very easy to use and learn. I love the fact you can use MySQL and SQLlite, but somethings we need to use Microsoft SQL database to retrieve data. Using MVD to this task will be so much easy, so, I challenge my self for several days to find a way to connect to MSSQL and voila.... Finally  I have found a way to this.  I have learn a lot about MVD using this forum that I wanted to share it with you. Thanks and enjoy

procedure LoadTickets_FROM_SQL (Sender: string; Cancel: string);
var
  Conn, rs : Variant;
  db_settings, FirstName,LastName,Phone: String;
  i: int;
var NxTextColumn: TNxTextColumn;
begin
   {***  create database objects ****  }
   Conn :=createoleobject('ADODB.Connection') ;
   rs := createoleobject('ADODB.recordset');

   {** open database connection ***  }
  db_settings:='Provider=SQLOLEDB;Server=myserver_name;Database=DatabaseName;UID=UserName;PWD=MyPassword';    //connection to database
   Conn.Open(db_settings);    //connection to database

   { query to get data}
   rs.Open  ('SELECT *  FROM Application where  TicketNumber  like ''%'+frm_main.fld_ticketnumber.text+'%''  order by DateTime asc;', Conn);


    //create table information
    frm_main.TableGrid1.Columns.Clear;
    frm_main.TableGrid1.Columns.Add(TNxTextColumn);
    frm_main.TableGrid1.Columns.Add(TNxTextColumn);
    frm_main.TableGrid1.Columns.Add(TNxTextColumn);
    frm_main.TableGrid1.Columns.Add(TNxTextColumn);
    
    //header name
    frm_main.TableGrid1.Columns[0].Header.Caption := 'First Name';    
    frm_main.TableGrid1.Columns[0].Header.Caption := 'Last Name';      
    frm_main.TableGrid1.Columns[0].Header.Caption := 'Phone Number';  
    frm_main.TableGrid1.Columns[0].Header.Caption := 'Date Time';  


   //initialized i
   i:=0;
   //while loop to get data from db
   while not rs.Eof do
    begin

        Application.ProcessMessages;

         //retrieve data and stored them in variables
         FirstName:=trim(rs.Fields['FirstName']);
         LastName:=trim(rs.Fields['LastName']);
         Phone:=trim(rs.Fields['Phone']);
         CDateTime:=trim(rs.Fields['DateTime']);

        //generate the data
        Grid.AddRow(1);
        Grid.Cells[0,i]:=FirstName;
        Grid.Cells[1,i]:=LastName;
        Grid.Cells[2,i]:=Phone;
        Grid.Cells[3,i]:=CDateTime;

        i:=i+1; //increment i
        rs.movenext ;   //next record
    end;


     //close connection
     rs.Close;
     Conn.Close;

end;              

Thanks for you help mathmathou. I wish there will be a way to manually close the HTTPGet connection because in some instances you need to leave the application open for long times. I also notice that this happens more frequently when I'm getting the content from the local network/Intranets.  Anyways after a few hours of research I found a solution.  This works for me and now I can leave the application open for a long time and when I need to connect again to the URL I no longer get the error message. Hope this helps someone else.

procedure get_html(Sender: string; var Cancel: boolean);
var http: variant;
begin
     try
         http:=createoleobject('WinHttp.WinHttpRequest.5.1');
         http.open('GET', frm_main.Edit1.Text , false);
         http.send;
         frm_main.Memo1.Text:= http.responsetext;
    finally
         http:= nil;
    end;

end;

When getting the HTML Contents from an URL using HTTPGet I'm getting the following error message "Socket Error # 10054 Connection reset by peer" only when the application has been idle for a while.  If I'm constantly using the application the error does not show up, it only shows when the application has not been use for a while.

Below is a sample code I use and  even if I use the TRY and EXCEPT the error message shows up. Any Ideas how to troubleshoot this issue.  Is there a HTTPGet.Free  option to free the TCP connection.

 
   url:=frm_main.Edit1.Text;

     try
         get_url:= HTTPGet(url);
         frm_main.Memo1.Text:= get_url;
    except
        if ExceptionMessage <> 'Socket Error # 10054' then  frm_main.Memo1.Lines.Add('Unknown Error') else frm_main.Memo1.Lines.Add(ExceptionMessage);
    end;

48

(3 replies, posted in Script)

I want to be able to check if a host/computer is ON using the computer name or an  IP address like 192.168.2.1..

I tried the code below I found in another post but it always fails. is there anything i'm missing. Please Advise.

Could you provide a sample project?


procedure Form1_Button6_OnClick (Sender: TObject; var Cancel: boolean);
begin
    if Ping('google.com') then ShowMessage('Ok') else ShowMessage('Failed');
end;

procedure Form1_Button4_OnClick (Sender: TObject; var Cancel: boolean);
var
    AvgMs: Double;
begin

    if PingEx('192.168.2.1', 5, AvgMs) then
        ShowMessage('Average ping: '+FloatToStr(AvgMs)+'ms')
     else ShowMessage('Failed');
end;

49

(8 replies, posted in Script)

Beta works.. I need help with my licence.. i sent an email to support@drive-software.com.. hope you can help.

50

(8 replies, posted in Script)

has anyone experience this issue?