Solved

how use a tdblookupcombobox editable

Posted on 2006-06-19
6
407 Views
Last Modified: 2010-04-04
in microsoft acces the combobox list column of table and insert the value in the same table, but i can type a new value,  in delphi  if use a query of table in list source an table in datasource, function but i cant type a value if not exist in query

this use in my aplication where edit a column can use value in the column of the same table o insert a new value
0
Comment
Question by:JesusOmarSanchez
[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
  • 2
6 Comments
 
LVL 7

Accepted Solution

by:
kfoster11 earned 63 total points
ID: 16939402
TQuery's result set is by definition read only.  But...

this is an excerpt from the help file.  Go to Delphi | Help | Index | TQuery and select Using TQuery
then select "Obtaining an editable result set "

here is the page.

To request a result set that users can edit in data-aware controls, set a query component's RequestLive  property to True. Setting RequestLive to True does not guarantee a live result set, but the BDE attempts to honor the request whenever possible. There are some restrictions on live result set requests, depending on whether the query uses the local SQL parser or a server's SQL parser.

Queries where table names are preceded by a BDE database alias (as in heterogeneous queries) and queries executed against Paradox or dBASE are parsed by the BDE using Local SQL. When queries use the local SQL parser, the BDE offers expanded support for updatable, live result sets in both single table and multi-table queries. When using Local SQL, a live result set for a query against a single table or view is returned if the query does not contain any of the following:

DISTINCT in the SELECT clause
      Joins (inner, outer, or UNION)
      Aggregate functions with or without GROUP BY or HAVING clauses
      Base tables or views that are not updatable
      Subqueries
      ORDER BY clauses not based on an index
      Queries against a remote database server are parsed by the server. If the RequestLive property is set to True, the SQL statement must abide by Local SQL standards in addition to any server-imposed restrictions because the BDE needs to use it for conveying data changes to the table. A live result set for a query against a single table or view is returned if the query does not contain any of the following:

A DISTINCT clause in the SELECT statement
      Aggregate functions, with or without GROUP BY or HAVING clauses
      References to more than one base table or updatable views (joins)
      Subqueries that reference the table in the FROM clause or other tables

If an application requests and receives a live result set, the CanModify property of the query component is set to True. Even if the query returns a live result set, you may not be able to update the result set directly if it contains linked fields or you switch indexes before attempting an update. If these conditions exist, you should treat the result set as a read-only result set, and update it accordingly .

If an application requests a live result set, but the SELECT statement syntax does not allow it, the BDE returns either

A read-only result set for queries made against Paradox or dBASE.
      An error code for SQL queries made against a remote server.
      
0
 
LVL 7

Expert Comment

by:kfoster11
ID: 16939404
Otherwise, use the TTable Component, but keep in mind this is much slower.
0
 
LVL 27

Assisted Solution

by:kretzschmar
kretzschmar earned 62 total points
ID: 16939682
usual a tdblookupcombo is used for
- a readable content
- a selection tool for valid entires
- avoid of unknown, invalid entries

so it is normal that you can't edit there entries,
you can only select known entries

additional (not checked) it could be
that the access combobox you have is not linked
to a lookup table (it may be just a list of predefined static entries,
because i don't think that access may able to insert into a lookup table,
by only editinig a (one, of maybe many fields in this table) lookup-field)

meikl :-)
0
 

Expert Comment

by:fvazquez
ID: 17251393
I've had the same problem, but instead of using a Tdblookupcombobox, I use a simple TEdit, then OnExit I tell the content to write in the table, and I populate a ComboBox in a way that every time I insert a new Item this is searched through the table, if it's  found then I'm able to edit it, if it's not found then it's inserted in the table. I hope this is of any help to you.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

749 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