Re: TADOQuery fields list box.
- From: Trevor <trevorjm@xxxxxxxxxxxxxxx>
- Date: Thu, 07 Jul 2005 11:21:54 +1000
Dan wrote:
On Sat, 02 Jul 2005 22:21:19 +1000, Trevor <trevorjm@xxxxxxxxxxxxxxx> wrote:
Not quite what I need. I can do it within the editor easily I need to do it with code so that when the program runs it does it at startup.
Thanks anyway.. Trevor..
<snip>
I now want the Fields list box to also show that the 2 new fields are there. The data in one of these fields is to be shown on the start up screen, and the display reads the data as such..
Label5.Caption := 'Your Name ' + Sys.FieldValues['Ver'];
where Sys.FieldValues is TADOQuery type and Ver is the new field..
So for the above to work I need to add the two new field names to the TADOQuery list box.
How are the field names getting into the list box? Are you getting the field info at runtime? If so, has the table been restructured yet?
At present field names are in the list box, cause before compile, in the IDE I have right clicked and added them. The table has not been restructured yet.
If you are checking the version directly from the exe file, why do you need to check the field names of a table which should already have been updated? Can the restructuring of the table be done as part of the version upgrade?
The version info that I'm picking up is the version of the database, which is MS-Access seperate file. The restructuring of the database is done after initial startup. Sort confusing, but I'll try explaining. The main database states whether the program is in shareware, demo or full access mode. On startup that is checked, and depending on reply, certain things happen. Once that check is done, then the update of the database is done.
I'm wondering if there is some confusion between design time and runtime information...
I have found a work around that gets me out of this problem, it isn't really pretty but sometimes thinking works.. What I have done is added a new TADOQuery element to the program called System2, this one holds all the fields including the two new fields. This element is not set to active yet. After the database is restructured then I set this to Active, and all is working.
Part of the original problem was that as I was trying to access a database and I had already set the fields in the TADOQuery list box, if I had it set to active on startup and some of those listed fields were not yet in the database, I got errors and program crash.
A little inelegant as I now have an extra TADOQuery element in the program that really isn't needed, but as a work around it works fine, and is really a simple fix.
hth, Dan
Thanks. Trevor..
.
- References:
- TADOQuery fields list box.
- From: Trevor
- Re: TADOQuery fields list box.
- From: Dan
- Re: TADOQuery fields list box.
- From: Trevor
- Re: TADOQuery fields list box.
- From: Dan
- TADOQuery fields list box.
- Prev by Date: Re: TADOQuery fields list box.
- Next by Date: OT: binary operators in SQL?
- Previous by thread: Re: TADOQuery fields list box.
- Next by thread: OT: binary operators in SQL?
- Index(es):
Relevant Pages
|