Link to home
Start Free TrialLog in
Avatar of graber
graberFlag for United States of America

asked on

TDBComboBox shouldn't it be able to populate itself?

I've been futzing with the TDBComboBox and the best I can to is one element from the database automatically.  I have set up the data source and data field correctly and played with the cache a bit but still just one element.  I need to get the entire field set into it to give the user to select from a series of registers.  Other examples on the net show how to manually add the elements to the database.  But that is just a TComboBox.  I have been playing with the properties and have failed miserably to this point.

This doesn't seem to be a difficult problem but I need some special Ed quickly.  One of you guys or gals know what I am missing to make this simple.  As with all other software process I don't have the time to investigate new tools..  yet again folks thanks ahead of time.
Avatar of graber
graber
Flag of United States of America image

ASKER

Just checked the borland sight and this is exactly the case.  Can any one fill in the gaps as to why?
Thanks
Avatar of kode99
kode99

The 'DB' aspect of the TDBCombo is just that,  it only edits the field you point it to.  So the dropdown is not connected in any way to the actual database.  

To get that kind of functionality you need to use the DBLookupComboBox which has the Datafield AND the ListFields.  Data field source is what you are editing and the list field source is what shows in the drop down.

Avatar of graber

ASKER

thanks kode I'll give it a try.
>>I need to get the entire field set into it to give the user to select from a series of registers.
Is this some kind of MPU like Atmel,Microchip??
If yes what is the functionality?
Maybe there is another way through.

George.
Avatar of graber

ASKER

Hey George!  While the software is hosted on a PowerPc the registers in question on not.  Communication takes place over a VME or PCI buss....  What do you have up your sleeve?

Kode-> I still haven't had a chance to attempt your suggestion.  If you have an understanding of how the Look up box is used could you give me a code snippet?
Gregg
>>Communication takes place over a VME or PCI buss....  
That means a physical (kind of) I/O Address??
If yes a lot of things can be speed up and solved using TIOPort component from www.winsoft.sk
That means reading AND writing...
There is also and TComPort from the same company for using serial communication (COM ports or USB)...
Both components served me well during the past 4 years...
Maybe I need more details to came up with a workaround...

George.
Avatar of graber

ASKER

Thanks George but per customer we are currently going ip
ASKER CERTIFIED SOLUTION
Avatar of kode99
kode99

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of graber

ASKER

Kode
Thanks..  There are so many options associated with the TDBLookupComboBox I never did make any headway with it.  Your explaination was great.  There is one last part to this and I'll wrap it up.  I noticed that was on OnChange event for this class.  There is an onClose for the mouse interface.  I tried the OnKey<press type> event but the break never caught it.  Any input?  And Kode thanks again.  You saved me alot of coding.
Gregg
You may need to use the OnKeyDown event.  OnKeyPress only works for ANSI character keys.  Depends on exactly what keystroke you are trying to catch.

OnChange will fire every time you make a single keystroke change to the field which may or may not be useful.

Sometimes I use the OnExit event to do processing after somebody has made a selections.  If i recall one problem with this combo was that it does not fire an event to indicate you actually have selected a item.  A lot of the 3rd party drop down components have a OnAccept event which is really handy.

All depends on exactly what the end result you need is.
Avatar of graber

ASKER

kode this works great I put a data set and data source on to the form and it's pretty slick.  I did hit a snag.  I can only create 62 of these forms before I'm hit with an exception.  If I remove the database elements I can create more.  No the data sets have there own connection strings and I got to wondering if I was creating more db connection than Jet or some other database element could handle.  I am going to start another thread and wanted to give you a heads up.
Thanks.
Gregg