Solved

how use a tdblookupcombobox editable

Posted on 2006-06-19
6
404 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Delphi with SQL Natvie Client 15 86
Help on project with Soap 10 48
Delphi inherited method 6 63
JAudiorecorder record freezing the app 29 60
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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

867 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now