Solved

How to Create a DB component with FIELD selector

Posted on 2001-09-16
10
271 Views
Last Modified: 2010-04-06
Hi, I want to create a DB component where I select the Datasource. That works correctly, but when I want to select the FIELD (TFIELD) I get a list of ALL fields. I only want to have the fields from the source I've selected in the object inspector.

Anyone knows How?
0
Comment
Question by:Avataris
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 4
10 Comments
 
LVL 8

Accepted Solution

by:
TOndrej earned 100 total points
ID: 6485749
Have a look in DBReg unit...

RegisterPropertyEditor(TypeInfo(string), TComponent, 'DataField', TDataFieldProperty);

This means that TDataFieldProperty property editor is registered for all string properties called 'DataField' of all TComponent descendants.

I guess your component is a TComponent descendant <g>.
Is your property of type string?
Is it called 'DataField'?

IOW, does the declaration look similar to the following:

property DataField: string read GetDataField write SetDataField;

??

Please be more specific, and show us how the property is declared and any other info you think might be useful.
From the symptoms you describe it seems that your property is of type TField... but I don't want to guess for no good reason.

TOndrej
0
 

Author Comment

by:Avataris
ID: 6485759
Yes the property is declared like that, I want to have a combobox with the fields from the table in the property editor.
0
 

Author Comment

by:Avataris
ID: 6485762
I don't have a DBREG anything :(
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 8

Expert Comment

by:TOndrej
ID: 6485763
Please show me the exact declaration and get/set methods and the internal field declaration.
0
 

Author Comment

by:Avataris
ID: 6485767
But I think i get your point :)
I'll test it now.
0
 
LVL 8

Expert Comment

by:TOndrej
ID: 6485772
I have it in <delphidir>\Source\Property Editors\dbreg.pas
(Delphi 5 Enterprise)
0
 

Author Comment

by:Avataris
ID: 6485776
Thanx, this method :

RegisterPropertyEditor(TypeInfo(string), TComponent, 'DataField', TDataFieldProperty);


Is all I needed :)
0
 
LVL 8

Expert Comment

by:TOndrej
ID: 6485779
It's strange that you needed it.

Anyway... You don't seem to be interested in a complete solution. Good luck.
0
 

Author Comment

by:Avataris
ID: 6486011
Thanx, this method :

RegisterPropertyEditor(TypeInfo(string), TComponent, 'DataField', TDataFieldProperty);


Is all I needed :)
0
 

Author Comment

by:Avataris
ID: 6486016
I don't have Delphi 5, just Delphi 4.
Delphi 4 has no examples about the subject.
Complete solutions take the fun of programming away ;)

But my component works fine now :)
Thanks!
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Suggested Courses
Course of the Month9 days, 13 hours left to enroll

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question