Re:TDatabase field access?
In article <327E89A9.5...@titleserv.com>, David Eisenberg
Quote
<deisenb...@titleserv.com> writes:
>If you access a field with TTable like this:
> MyTTable.FieldByName['MYFIELD'].AsWhatever := ... , or
> MyTTable['MYFIELD'] := ...
>then, how do you access that same field through a TDatabase??
In response to this and your other post, regarding a TDatabase not working
- TDatabases are used to set up a local alias. This local alias is then
used by TTables and TQueries to establish where the physical tables exist.
The reason to use a local alias and not a global (IDAPI established) alias
is that you can move tables around and just change the location in one
place in your program, and you are not tied to the IDAPI defined aliases
(that can be messed up by those darned users).
In other words, whether the TTable uses a local alias (TDatabase), regular
alias (from IDAPI), or a fixed location for finding the physical table
makes NO DIFFERENCE when you are accessing the fields.
The alias created by a TDatabase is global to the application and should
be able to be referenced by any table or query on any form in the
application.
I think you need to look at the help files on the DatabaseName and
AliasName properties for the TDatabase component.