601

(8 replies, posted in Script)

Actually, when I enter the table name in the field foreignkey, it searches in the table but I get an error :

"no such column: tablename"

and all subsequent queries are stopped...

When using the script I get an error when using a search button using the scripted combobox as a source for the id because the SQL query does not know which table.column corresponds to the id retrieved.

near"=":syntax error

The query looks like this when using default search properties for a button (no use of script for the search) :

SELECT DISTINCT TABLE.COLUMN, etc....FROM TABLENAME WHERE=1

it should look like

SELECT DISTINCT TABLE.COLUMN, etc....FROM TABLENAME WHERE +COMBOBOX1.id+=1

Does that mean that I would have to write all my application using scripts? sad

602

(8 replies, posted in Script)

Thanks a lot Dmitry, I did not know that we could fill in the combobox property with a table name. Good to know.

The less script, the better in a project anyway smile

603

(8 replies, posted in Script)

Dear all,

I am looking for a way to create a custom Query for a combobox which  should show an information without any relationship for the source. I mean the source of my queries afterward would be this combobox.

example:

let say, I have 2 tables

Table 1                        Table 2

a                                   10 
b                                   50
c                                   80
d                                   100
e                                    20
                                      id.table1



I want a combobox with the list of the content of Table1 which will display according content of Table2 in a grid.

In current version, I can only choose the foreignKeys which does not help in my project. Any idea, suggestion?

604

(3 replies, posted in Script)

This looks a little bit "dirty" as if you share your application with somebody else, what has been saved in YOUR registry will not be handed over to another computer.

605

(30 replies, posted in General)

Any other improvement with this version?   big_smile

I would use a trigger in MySQL and an ODBC connection to the SQLite db to insert newly created data or maybe create a batch to export and import data.... there are plenty of options out there smile

607

(6 replies, posted in Talks about all)

Do you think it would be a good idea to share some snippets?
Kind of a snippet KB smile

It may help everybody in progressing with the creation of wonderful applications. What do you think?

608

(7 replies, posted in Script)

Thanks for the hint Dmitry, however

Form1.Edit1.Color :=clBtnFace; 

does not work, I had to replace clBtnFace by $00CCCCCC

Here is how I implemented it:

if AddInfo.AddPos.ReadOnly then AddInfo.AddPos.Color :=$00CCCCCC else AddInfo.AddPos.Color :=clWindow; //grey out the field when read only

Is it possible to change the background of a Textbox when set to Read Only?

I have some textbox which become read only on certain conditions and I would like to show that these textboxes are actually not editable. When back to Read And Write, the Textbox background should go back to default.

Any hint?

610

(4 replies, posted in General)

Thanks a lot for the tip to get the info from a grid into a textbox, I was wondering how to do it for months smile

I found this which confirms the lack of Unicode management (utf) in SQLite http://forums.devart.com/viewtopic.php?t=18222
alongside this http://site.icu-project.org/

I was pretty sure the button trick was not as straight forward as it seems smile Thanks for the tip.

What about the "Localized" option in SQL Query? http://stackoverflow.com/questions/1324 … abetically


SELECT column1, Column2 FROM Table ORDER BY column1 COLLATE LOCALIZED ASC

Oh! yikes

I would like to see a screenshot of your method since I tried with no luck! My buttons are still grey!

I already asked question b and answer was negative smile

As mentioned by JB, you could also store your project on a shared folder (as I do for a corporate small app)

Hi,

good to hear that you sorted it out, well done. Keeping databases updated is the easiest part of the project smile

Send the full folder without the .vdb file ( the project file) to you Admin personnel only once and after that, exchange the SQLite.db file when the application is closed. This file contains all your data, the value of your company wink Keep a copy of this file somewhere safe at any time!!

I have been trying to understand your need but I still do not get what you are trying to achieve, honestly speaking...  I tried to re-design your project but I am lost with the context. You want a database to list your vehicles but I do not understand the purpose of the tables Accident and Inventory, your form  TruckOne is looking for information into Accident which makes no sense to me when this form pops up when clicking on a button which looks like adding a vehicle.

What do you mean by inventory in multiple locations? What do you call inventory actually smile We all have our own words and our way of thinking wink

In new diagram, there is a id_Trucks relationshipship linked with nothing...

Ok, I think you did not get what a database is actually smile

You want a truck inventory, then instead of thinking the trucks should be separated, try to imagine your database as a big garage. Would you fit the garage inside each vehicle or the opposite? wink

I will try to design something very basic with what you sent above.

I had a look at your project but it is unclear what you want to achieve here!

Why 2 buttons on start to do the same thing? Why creating an inventory with no possibility to see it? It is a bit confuse for me smile

You were maybe misled by the design of a table, try to imagine that the lines are actually columns in an excel sheet.

The purpose of a database is to gather all information of same kind at the same place.

Designing the tables and relationships is the most important part of your database, you have to think about what you want to see, how you want to see it, how information should interact and how you could do it in the simplest way possible. Always think KISS ( keep it simple stupid) and avoid redundancy.

Remember that in a database, a record is a line with several columns, a relationship is the id of another line in another table. We use relationships to avoid information redundancy and to ease the maintenance by splitting the information. It is easier to maintain a small table (adding, removing columns, modifying content meaning, etc...)

In your case, you only need one table Trucks and maybe draw something on the paper to clarify your view.

All your trucks will be in same table but can have different properties

What is the departure point? Trucks? Accidents? Vehicule input? Vendors? Parts?

If you struggle too much, you could also submit your project to the forum and we will help you. wink

Why so many Truck tables? smile

The view could be cleared up by moving the tables in order to clarify the output !

I think I understood what you want to achieve, could we see how your database looks like please? Click on the button next to "New Table" in MVDB and send a capture of it.

I think you are missing the correct use of relationships and comboboxes or you are not using "Show Record" property for your button. There might be a design issue as well smile

I still do not understand where / how you want this information to be displayed, could you create some kind of photo-montage?

625

(5 replies, posted in General)

Do you mean that you want to replace the white space before the values in a combo by the text "All" ? That would be a great idea!