Topic: Distinct
Hi,
can I use the command DISTINCT in a combobox ?
What I wanna do is to show in the combobox records from a table, but if there are the same record it should be only ones.
Thank's in advance
My Visual Database → Script → Distinct
Hi,
can I use the command DISTINCT in a combobox ?
What I wanna do is to show in the combobox records from a table, but if there are the same record it should be only ones.
Thank's in advance
Hello,
You can use method dbSQLExecute
Can fill the component the resulting of SQL query.
Note that in SQL query is a field "id", the component could know what records in the database belongs to the selected item.
Example:
Form1.ComboBox1.dbSQLExecute ('SELECT DISTINCT fieldname, id FROM tablename');
Hi,
I have add the script in the ComboBox but it doesn't work
I attache my example in here so you could have a better look.
Thank you in advance
take a look!
The distinct works fine
but there is a problem. when you choose a name from the combobox and write somethin in the textbox and save it,
you will see in the tablegrid that the saved record has only the value of the textbox and not the choosen one from the combobox.
Can you please see it ?
I see. Instead of viewing same names in combo you have to restrict double adding in combo. I think it would be more good.
the idea is that i have already a database full of values.
I will include in the main software a script excluding the same names from saving, but the problem will exist because the database is not new.
My question is choosing the names from the combobox it refuse to save the record.
take a look at this!
no the script does't work.
send me again your project
sent it
I am afraid, I do not understand your problem, when I click on the combobox I get unique values even without the script!
Could you please explain what you try to achieve? Maybe a picture would help us.
See the picture what i am asking
Which version of MVDB are you using? I am using 2.2 and the script is deactivated. Last entry has nothing linked on purpose.
2.3 beta.... because I am at work. and the version is portable
is there a way to find the version 2.2 cause home I have update it in the new version ?
Portable version? Where did you find it?
http://myvisualdatabase.com/download/se … 20beta.zip
it is the Beta version.
You can find it in the Forum section General and the first option
Sticky: Beta version 2.3.
ok found the 2.2 version . The tablegrid works fine, but the script not
which script?
http://myvisualdatabase.com/forum/misc. … download=1
This script doesn't work. The script was from the member pha1984
It works perfectly, you may have an issue with your setup!
I changed nothing in the script, just added the title to the columns in the grid to understand what was going on.
Thank's maby the version 2.3 is not ready yet for use.
Could you send me the 2.2 version ?
I have update it in 2.3 and lost the previous version.
I cannot attach it as the file is too large according to the forum's message:
Warning! The following errors must be corrected before your message can be posted:
•The selected file was too large to upload. The server didn't allow the upload.
I do not use 2.3 yet due to too many issues at the moment.
Anyway, thanks pha1984 for the script, it is much smaller than the one provided by Dmitry to check the duplicates!
thank's
I have installed the 2.2
But the script http://myvisualdatabase.com/forum/misc. … download=1 works only fro the first record.
After that it let you to add records with the same names
My Visual Database → Script → Distinct
Powered by PunBB, supported by Informer Technologies, Inc.
Theme Hydrogen by Kushi