Re: TADOQuery fields list box.





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..



.



Relevant Pages

  • Re: Protecting DB
    ... Security (ULS). ... Assigning appropriate permissions to various database objects ... startup properties for your users. ... to disable the Shift key bypass for those users who are wedgie resilient. ...
    (microsoft.public.access.modulesdaovba)
  • Re: Opening codes
    ... Doug Steele, Microsoft Access MVP ... 'This function will disable the shift at startup causing the Autoexec ... Dim db As Database ...
    (microsoft.public.access.modulesdaovba)
  • Re: Opening codes
    ... more secure syntax shown in http://www.mvps.org/access/general/gen0040.htm ... 'This function will disable the shift at startup causing the Autoexec ... Dim db As Database ...
    (microsoft.public.access.modulesdaovba)
  • RE: Retrieve no. of forms, tables, etc. from Access DBs
    ... There are, I believe, two ways to make screens like this ... Startup code that is... ... Any of the 25000 database in the list may contain code that runs ... If so, when I run the below example in Excel, code execution ...
    (microsoft.public.access.modulesdaovba)
  • Re: Lock Users Out
    ... You, as the developer, should have your own copy of the mdb. ... You can lock down the interface, so that they don't see the database window. ... Create a startup form that is opened on ... If you need to bypass these startup features, you can hold the shift key ...
    (microsoft.public.access.security)