Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 973177
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T03:14:25+00:00 2026-05-16T03:14:25+00:00

I want to change our search as it is a bit hacky now. Currently

  • 0

I want to change our search as it is a bit hacky now.
Currently it works like this:

  1. User enter a text in a textbox, for example Volvo and start searching.
  2. This search with SQL all posts containing Volvo.
  3. The result is a list with 2 columns, BoldID and DisplayValue.
  4. BoldID is just an unique number to identify the object in database.
  5. DisplayValue is what the user see in the list of results.
  6. Each row in the resultset is identified with a row number in users list. The first with 1, the second with 2 and so on.
  7. There is also a limitation to only show max 99 hits by intention by looping the query in code. It is not good to have a query that returns many hits as it no meaning to have more in the users hit list. The search should be more specific in that case.

The result list is displayed in a separate global window called rightpane. The hacky part is that if searching from a modal dialog then rightpane must be undocked from the main window to be able to pick a value with the mouse. We suspect this could be a reason that the application sometimes lock itself with the modal dialog behind the main window.

After change it should work like this:

The user enter text in a Combobox and start searching with SQL on demand like before. But the resultset is displayed in the combobox. So I only want to change the display if possible as there are a lot of old SQL queries that is in use and works fine now.

We use Delphi 2007, Interbase 2009 and components from DevExpress. Yesterday I tried to connect a customdatasource to a combobox, but I realize this was not implemented yet. See How to use a TcxCustomDataSource in a TcxExtLookupComboBox. I want to use a custom datasource to implement row number and max number of hits. Se 6 and 7 in the list above.

So now I see 2 options:

  • Use a DB-aware combobox
  • Use a textbox and attach a grid to it to display the resultset.

The combobox is simpler because it is a whole component, but I don’t know how to implement feature 6 and 7 from the list above.
The textbox + grid give more freedom but require more work.

I prefer the first option. The current problems is:

  • I think Interbase SQL cannot restrict the amount of hits in the resultset. It must be done with code. How is this done with a DB-aware combobox ?
  • How can I display row numbers in the resultset ?

Update 1:
Requirement 7 is solved thanks to Marjan, thanks.
As for 6 I think it is harder. Ideally I want it in SQL so I could extract an own column like Adding row no. But Interbase don’t support that.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T03:14:25+00:00Added an answer on May 16, 2026 at 3:14 am

    Requirement 6:

    Assuming that the db’s id value is an integer, you can use the tag of a control or the Object of the strings in a combobox/listbox to store the id value.

    [pseudo code]

    while not eof do
      ComboBox.Items.AddObject(<DisplayText From Db>, TObject(<IntegerID from Db>));
    

    and use it like so

    id := Integer(ComboBox.Items.Objects[ComboBox.ItemIndex]);
    

    Requirement 7:

    Using a db aware combobox/listbox looping through the query til eof or 99 rows is out. So you would need to rely on SQL. Even if you do not want to change any of the current SQL statements, you could use SQL’s “TOP” feature to limit the number of rows. For example

    SELECT TOP 99 FROM (<your original SQL>)
    

    In Interbase SQL you can use the phrase:

    ROWS 1 TO 99 
    

    just after the order clause (see example at http://blogs.teamb.com/craigstuntz/dtpostname/ibsqlintro/ – almost the bottom of the page)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to change a number to a string like this: var i =
I need to change our log format. Now the log looks like: [Thread ID]
I want to change the background color of our apps main window when a
i have many div's with the same background image and i want change this
I want to change the background color of a textbox as an indicator that
I have done stuff like this before, but I want to figure out the
I'm new to sencha touch. I have a list-search example. Now I want to
For the next version of our application, I want to change the sharedUserId since
How to Change the default Application image in android??we want to distinguish our application
I have been assigned a task that I should change our solr search to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.