176

(3 replies, posted in General)

you can also try

CONCAT(COALESCE(firstname,''),' ',COALESCE(lastname,''))

But you can also use and retain function IFNULL instead of COALESCE as Derek's Code. It'll work just fine too.

177

(30 replies, posted in General)

gonpublic2k wrote:
brian.zaballa wrote:
asawyer13 wrote:

Hopefully MVD Dev will read this and have a solution.

Even disabling the encryption would be better than not being able to use it.

Alan

I got on how the password is being hashed. I just don't know if it is proper to post I here. smile I'll email it to you

Hi, could you e-mail me this please??

leggin2020@gmail.com

I'd appreciate it , thanks!!!

Sent.

178

(9 replies, posted in Script)

You're welcome. Been trying to make your regex code to work but no luck is with me. Mind to explain what are you trying to obtain with that regex? I'm not that good when it comes to regex but maybe I can or someone can help you with the output you are trying to obtain, but not doing the regexp class. I can't find any documentation to make it work.

179

(11 replies, posted in Script)

You can also try creating your own version of IncMonth if it is not available in ver1.44,

function AddMonth(const DateTime:TDateTime; NumberOfMonths: Integer): TDateTime;
var
    _m,_d,_y : Integer;
begin
    DecodeDate(DateTime,_y,_m,_d);
    result := EncodeDate(_y,_m+NumberOfMonths,_d);
end;

Add it in your code and you can use AddMonth just like of the IncMonth

180

(11 replies, posted in Script)

ehwagner wrote:

You could also use the IncMonth function which adds months to the date as follows. 120 equates to 10 years.

Form1.DateTimePicker2.DateTime := IncMonth(Form1.DateTimePicker1.DateTime, 120);

Woa, didn't know this exists, Use this instead of my suggestion. Another knowledge to treasure.

181

(11 replies, posted in Script)

You can try decoding and encoding the date

procedure frmFornitore_dtData_OnChange (Sender: TObject);
var
  mm,dd,yy:Integer
begin
  DecodeDate(frmFornitore.dtData.date,yy,mm,dd);
  frmFornitore.dtScadenza.date :=  EncodeDate(yy+10,mm,dd);
end;

182

(9 replies, posted in Script)

This is not a regex but do the trick. I hope you can get some idea with this one.

183

(9 replies, posted in General)

try this one.

ShowMessage(Form1.TableGrid1.Cells[Form1.TableGrid1.SelectedRow,0]); // string

You can access the properties, functions etc by just typing the Grid, followed by dot(.)

Form1.TableGrid1.

then, Hit Ctrl+Spacebar. this will list down properties, functions, etc

184

(9 replies, posted in General)

kweatherhead wrote:

Brian,

Thanx for the reply !!

I am using ver 6.5

ShowMessage(frmLstClients.TableGrid1.Cell[0.0]);  // this gives me: Not enough actual parameters

ShowMessage(frmLstClients.TableGrid1.Cells[0.0]); ;; gives me:  the same error

if frmLstClients.tablegrid1.cell[0.0].AsString = ' Add A New Client'  then frmAddNewClient.show;

as does the above in the way I was originally trying to use it, whereas

if frmLstClients.tablegrid1.cells[0.0].AsString = ' Add A New Client'  then frmAddNewClient.show;
// says Strings do not have properties or methods

any ideas?

Thanx,
Keith

Maybe you are using dot(.) instead of comma(,)
try changing Cells[0.0] to Cells[0,0]

185

(9 replies, posted in General)

kweatherhead wrote:

Greetings,

I have a TableGrid on a form and I would like to grab the value of the first field in the first row... what is the proper
reference to grab that value?


Col1,  Col2,   Col3
xxx      yyy        zzz


I want to access  the "xxx", can someone please give me a example syntax.

Regards,
Keith

if Form1.TableGrid1.RowCount > 0 then begin
    //ShowMessage(Form1.TableGrid1.Cell[0,0].AsString);
    //ShowMessage(Form1.TableGrid1.Cell[0,0].AsFloat);
    //ShowMessage(Form1.TableGrid1.Cell[0,0].AsInteger);
    //ShowMessage(Form1.TableGrid1.Cell[0,0].AsDateTime); 
    ShowMessage(Form1.TableGrid1.Cells[0,0]); // string
end; 

186

(0 replies, posted in General)

Is there a way to disable RTF popping Save As Dialog when Ctrl+S is pressed?

187

(4 replies, posted in General)

Try blackpearl's example. Just add a condition before updating the grid. It'll be a bad experience for the user when navigating the grid if you reload it. unless your grid is only for viewing.

procedure updateGrid ;
begin
    if not Form1.TableGrid1.Focused then
        Form1.TableGrid1.dbUpdate;
end;

Then again, you have to consider the traffic, If you are accessing database online, then there's a drawback. It will continuously sending a request. Trap it If your grid is accessed in a popup or not in the main form by adding another condition

procedure updateGrid ;
begin
    if ((not Form1.TableGrid1.Focused) AND (Form1.Visible)) then
        Form1.TableGrid1.dbUpdate;
end;

188

(3 replies, posted in Script)

You can print it via Report.

189

(30 replies, posted in General)

Please check on this one please. I hope you can include it in your update.

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

I love the new update, but I need the latest build of sqlite for my projects.

190

(0 replies, posted in General)

Good Day MVD Devs.

It seems 6.5 update arises this problem on one of my projects. Can you include the latest build of sqlite in your update. If not, I hope you can include a fix on this one. It occurs when printing a record of a child and displaying a parent of the parent of the child being printed.
E.g. Printing a Post of a User that is connected in a Department.

Sql Query

Here, I made a sample. included in the zip is the latest build of sqlite3.dll I'm using. Thank you.

191

(30 replies, posted in General)

wenchester21 wrote:

Hi folks, I'm getting this error when I try to remove the "bold" property from the button.  Any idea of the problem?

Error: Invalid variant operation

frm1.button1.font.style := frm1.button1.font.style - [fsBold]

Don't put fsBold into array.

frm1.button1.font.style := frm1.button1.font.style - fsBold;

192

(1 replies, posted in General)

v_pozidis wrote:

How can I conect my sqlite.db with MySql??? Is this possible ? Any simply example for using the Mysql ???

They are different. I suggest to do just one. Integrating the two databases takes a lot effort and skill to do. If you are developing an application that requires multi-user that the user can access simultaneously in the system, then go with MySQL. For a desktop with single-user at a time, then go with sqlite. You can do LAN-based sqlite, but there's drawback in that so I wouldn't recommend it.

193

(4 replies, posted in General)

the3dmen wrote:

i have programmed MVD with MySQL connection and web interface
i want to know how can the table grid autoload from the database when someone adds a new entry to the web interface

I think it is better to just put a button and manually update the grid
e.g.

Form1.Tablegrid1.dbUpdate;

I got some idea on how to make it auto-reload but it's kind of messy.
If you know trigger in MySQL, then you can use it to update a table (`settings` maybe) that will increment if a user add, update or delete a record in a table, then you can have a loop in script that will check on that table.
On load of your system, store that `setting` value in a global variable or store it in the refresh button's tag, etc, your choice. then if the data from database changes or not same with the data in your variable/button's tag, reload the grid.
You have to consider traffic in your server though especially if you implement this with several tablegrids.

194

(9 replies, posted in Database applications)

Good Day. Just want to share with you guys this trick.
If you are tired of changing the icon of your compiled application each time you are making an update, then this one might help.
Use on your own risk. smile Just kidding, it will backup your current builder.dll
I'm using the latest build 6.5 when I created this. If you want to use it in lower version, then you have to remove all dll's in Builders folder and replace it with your updated dll's based on the current builder.dll of your MVD.
BTW, Happy to see MVD's update again. <3


Pre-requisite: Must know how to use Resource Hacker.


Step 1: Copy builder.dll from MVD Installation folder (In my case "C:\Program Files (x86)\My Visual DataBase\") and paste it in Desktop for easy changing the icon inside it.
Step 2: Change icon of the builder.dll (For me, dragging builder.dll to Resource Hacker Shortcut)
Step 3: Duplicate builder.dll(changed icon), rename it (e.g. builder_myicon.dll) and paste it under "IconChanger\Builders"
Step 4: Make sure to RUN IconChanger as Administrator to be able to update or replace current MVD's builder.dll
Step 5: Check on MVD Path. Make sure that the path is in right place.
Step 6: IconChanger will automatically add and/or delete files in the database (based on what dll's found in the Builders folder, just update its descriptions.
Step 7: Choose icon from dropdown and click "Update MVD"
Step 8: Open your MVD Project, then try compiling it. big_smile


I've been developing several applications using MVD and this IconChanger help me to reduce time consumed when changing the icons after compiling it.


Here's the download link, I included the source code and executable and couple of sample modified builders so it has bigger size.
https://www.dropbox.com/s/7a6u2vxf41g2r … r.zip?dl=1

195

(4 replies, posted in General)

I'm not so sure on what you really want. But here, I previously made a function involving arrays. I hope it gives you an idea to what you are looking for.

196

(3 replies, posted in Script)

if you are using sqlite use

sqlexecute('UPDATE EXAMPLE SET  NAME = "11333311" WHERE id = "3"');
reply:=sqlexecute('SELECT changes()');

for mysql, use

sqlexecute('UPDATE EXAMPLE SET  NAME = "11333311" WHERE id = "3"');
reply=sqlexecute('SELECT ROW_COUNT()');

197

(4 replies, posted in General)

It's hard to check it without seeing all the actual script and forms. maybe if you can attach the project. Someone can see and check it.

Oh, I think you copy your button and paste it somewhere. Check that buttons, if its action is show record and pointing to the grid you are double clicking, then that's the reason why forms are popping. You can check on Derek's way of doing the double click for you to have other option. smile But if you want to use the ShowRecord method like I'm used to, make sure that you don't duplicate that button and put it somewhere in that form to avoid that popping forms.

Good Day. If you could share your application, maybe I or someone can look what's going on with it. If not, try to lay down as much as code and/or screenshot you can so we can help. It's hard to know the problem without looking at the source.

Here's the code I used in this kind of situation. I hope it gives you an idea.