251

(6 replies, posted in General)

You can add users using the admin account.

As for the error, sometimes i encountered error too saying cannot create table something like that but since its only appearing when connecting in mysql when developing and does not affect or produce error when the application runs, i just ignore it.

252

(6 replies, posted in General)

Good day.
It's been a while, electricity and internet is a bit difficult here due to a super typhoon struck us.
Anyway, I think it is better for you to give a detailed process/procedure you are trying to achieve. It is easier that way. If you can create a simple program to show it then specify to what process you are stuck with. It is much better for someone to give you an idea. As to trigger asawyer was talking about. It is an advance feature of sql (sqlite in your case i think). You can google it (how to create trigger on sqlite) for you will have to do it manually(sql query). You can use database viewer software to do it too(e.g. navicat-paid). There's another option like having a hidden component to hold the Date you are trying to save in another table. but as I have said, it is easier if you can narrow it down by citing a detailed explanation.

253

(72 replies, posted in General)

unforgettable wrote:

Hi brain
       In fact I want to get result same as pic on form No_Sales. Run this project and on form1  click button 'No of Sales'. See what is wrong to display with it.
Thanks to guide.

I already gave you my side on that kind of report you are trying to display. I'll reiterate it, the previous report with that kind of display is the count of items per category. and that is very obtainable. But to display item names instead of the item count in a row with different categories is a No No. I cannot help you with that. Sorry.

254

(72 replies, posted in General)

You can try to group it by date and category.

255

(72 replies, posted in General)

unforgettable wrote:

hi brain
          Look at attached project. I am trying to get what I want but it is not working properly. There is some mistake or I could not enter codes correctly. On form2 I got text from combobox2 to EI madedit1 and save it to table sales's field sitem. I made Edit1 enable.Now on form No_Sales by pressing Query button I am not getting desired result. Help plz.

Again, I would not suggest the report you are trying to obtain. It is a little messy and difficult or let's say impossible to obtain. I would suggest you go with the detailed report. As I can recall, the report on No_Sales form is displaying the count of items per category(which we redesign/recode in No_Sales_2) and not in detailed. The problem on the report you are trying to obtain like in this image http://myvisualdatabase.com/forum/misc. … mp;preview is not possible with the database structure and in my opinion, I really won't suggest it. The problem with that kind of report is Having multiple items with the same category in a Sales_ticket or with the same date. Other explanation to it is that you don't or cannot align 2 items with different categories in one row for they are in separate record(sales table).

256

(2 replies, posted in General)

dhekabai wrote:

Hey, I have a table with the date the loan was taken and a column with number of months Interest was paid. I want a calculated field which shows me how many months are remaining. I can't even get past getting the current month number in a calculated field number using SELECT strftime('%m', pt_date)   (and pt_date is the name of the column in the table.)

I just need something like ((year(today) - year(pt_date)) * 12 ) + (month(today) - month(pt_date)) which will give me the total number of months, from which I can subtract the number of months it has been paid which is in another  column.

Thank you!

try casting it

((cast(strftime('%Y',DATE('now')) as integer) - cast(strftime('%Y',pt_date) as integer))*12) + 
((cast(strftime('%m',DATE('now')) as integer) - cast(strftime('%m',pt_date) as integer)))

257

(6 replies, posted in General)

abu7akm wrote:

Icon not found




Role-based acces control"

It might be on your MVD Version. It was introduced on Version 6.1. http://myvisualdatabase.com/forum/viewtopic.php?id=5724

258

(6 replies, posted in General)

abu7akm wrote:

Can I create a program for each user name and password that enters into a specific form?

Programmatically with MVD, Yes. You can use the Role Feature of MVD that can be see in the Object Inspector. You only need to enable the Role Function. You can check on this documentation http://myvisualdatabase.com/help_en/roles/roles.html. I attached a simple program for it.
Username/Password:
admin / admin
user1 / 123
user2 / 123
If you want for dynamic user access (Can be updated by user when program is deployed), you can check on this post http://myvisualdatabase.com/forum/viewtopic.php?id=6928

259

(72 replies, posted in General)

unforgettable wrote:

Thank you brain. I want to use option one. Add seven fields but how it will populate and how get value from combobox2. I am trying to get result as shown in attached pic. How it will be?

In that case, I think it is better for you to just use the sales table and display or group it by category.

260

(72 replies, posted in General)

unforgettable wrote:

Hi brain
         How re you? Today I would like to ask some things about combo box in project last you attached. From combobox2 on form2, how can we display its datas on No_Sale_2 form's tablegrid1?

It'll depend on how are you going to represent the data. As far as I know, Report on No_Sales_2 Form is distinct by Date. So you will have 2 options there to display the flat rates.
Option 1: Is to show flat rates for each category (books, pens, etc.) but this will add fields (7 fields on the current categories) on qtable
Option 2: Is to show total flat rates given for the date. In this case, you only need 1 field to handle the data.

261

(72 replies, posted in General)

unforgettable wrote:

Sorry brain you don't understand what I want. In fact I want to know how to use checkbox using one event. in Attached project I added checkbox on form2 to show flat price 10. Sometime store keepers offer flat price on specific items. So how this project manage flat price. I think you will understand what I want to know.

You can add flat_rate field on items, then you can just get it under the Combobox OnChange Event when checkbox is Checked.

262

(6 replies, posted in General)

I haven't explored Embarcadero RAD. But I think it has more wider scope than to what is used in MVD. I've been searching before on how to create my own functions (Type) and I find out that MVD uses fastscript engine that means no type declarations (records, classes), etc. Anyway, in terms of functionality, overall, I love MVD. It is easy to setup and a total newbie on Pascal can easily adopt on its scripting. I was a total newbie on Pascal before using MVD and it took me a couple of months to familiarize the environment. Well I think my average knowledge on MySQL helps me since I'm on web development before using MVD. One more thing I'm looking forward is Object-Oriented Programming but since it has no type declarations, I give up on that. Just hoping it can be included in the future release.

263

(8 replies, posted in Reports)

You can also check on the Calculated Fields. You can easily get the sum you want there. It's like a temporary field that works like a sub-query.

264

(6 replies, posted in General)

To be exact, it is FastScript

265

(72 replies, posted in General)

unforgettable wrote:

Thanks brain. Look at attached project I add  a check box on form2. I typed code for event Form2_CheckBox1_OnClick (Sender: TObject); It works very well. How can I type code for event Form2_ComboBox2_OnChange (Sender: TObject); and how it will affect on No_Sales2 form?

Sorry, I'm not so sure on what you want to do with the checkbox. Be specific on citing the function/behavior/process you are aiming for and someone might know and help you with it.

266

(3 replies, posted in General)

Here's a sample. Hope it gives you an idea.

267

(72 replies, posted in General)

unforgettable wrote:

Thank you brain. To unzip it needs password? It is giving an error message "XML document must have top level element. Line:0".
My second issue is how to use and in if then statement for two condition must be true.

Attached zip don't have password. I just zip it using the zip function of windows.
as for the AND, easiest way is to enclosed them in parenthesis.

if ((CONDITION1) AND (CONDITION2)) then begin
    // your code here...
end else begin
    // when failed
end;

268

(72 replies, posted in General)

unforgettable wrote:

Thank you brain. Can you send keys number as you mentioned in pic?

It's the key from keyboard, 13 stands for Enter key. Here's a sample for a barcode reader function. Hope you got the idea.

269

(72 replies, posted in General)

Its in the Event tab on the left side. You don't need another combobox for the barcode, you can have another field in items table. An int or string can handle barcode.

270

(72 replies, posted in General)

unforgettable wrote:

Thank you brain. I would like to know why did you add Edit1? For which purpose? Second we can add third combobox? which contain code of items? Third how can we add and edit component to use bar code reader?

I didn't add that Edit1, It is already there but you wont be needing it for It'll be redundant to have the item name in sales item for it is already on item table.
As for the barcode., you don't need another combobox, just add a field on the item table to save the barcode.
You only need to understand how barcode reader works. It simply read the barcode by scanning, then typing it with Enter Key after it typed the code it have read. With these, you can focus on a textbox, then catch that Enter Key with the OnKeyUp method of the textbox, then you can perform a search query from item table.

271

(72 replies, posted in General)

unforgettable wrote:

Thank you brain you have given a good idea. Let me to go ahead. In this project look at form2 we mus add and other combobox and combobox1 must be its parent. As we select items from combobox 2 its price automatically show on edit2. how it will possible?

Just add another table (e.g. items) with relationship to Category, then have a relationship on sales table pointing to the new table

272

(72 replies, posted in General)

Here. I just cant hide some details of expense from report. I'm not that good at it. Hope someone has the idea to do it.

By the way, I again didn't update the date filter on No of Sales report agusecc pointed. Just update that one.

273

(72 replies, posted in General)

Upon checking, It is not possible due to the query made in Income Statement is grouped by Category and is selected in sales table.
Your discount is in the Sales_Ticket table. My suggestion is that you move the discount to sales table for it to be accessed in your current Income Statement Report.

274

(72 replies, posted in General)

unforgettable wrote:

Hi brain
          How are you? Plz make changes for income statement and print too. One error message display when I enter same codes in another project. What does mean and its sosolution? See attached file.

Please make a detailed explanation to what you want to print for us to see what we can do to help. Count, Sum on a table etc. It is easier that way.
If you can also attach the mvd project with that error, someone might see what's wrong with your query/code.

275

(3 replies, posted in SQL queries)

You can also add this query after deleting all records for it to function like truncate.

SQLExecute('DELETE FROM sqlite_sequence WHERE name="yourtablename"')