Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread list of databases / database names
Sun, Feb 3 2008 10:36 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Tim (or anyone who can answer really)

As part of my query generator I'm going to have to tag fields, and especially joins with the database. It gets complicated in that live data can be archived. The archive database structure will be identical to the live one, and users will be allowed to switch between so for a simple installation I'll have:

Memory (my name for the in-memory database <vbg>)
xx-Live
xx-Archive

I want to be able to use the same query definitions for either live or archive which is a doddle for many things but remember my predilection for creating memory tables Smileyso I need to qualify the from tables.

The problem comes at design time. Currently I'm passing the SessionName through to a form I use to edit the component properties, and I was just getting a list of databases from the configuration stuff. What I want to do now is store the DatabaseName not the Database and then do a StringReplace at run time. Any suggestions as to how to do this and link the two together because I also need the Database when getting field lists.

Hope you followed that.

Roy Lambert
Mon, Feb 4 2008 3:58 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Roy,

<< The problem comes at design time. Currently I'm passing the SessionName
through to a form I use to edit the component properties, and I was just
getting a list of databases from the configuration stuff. What I want to do
now is store the DatabaseName not the Database and then do a StringReplace
at run time. Any suggestions as to how to do this and link the two together
because I also need the Database when getting field lists. >>

Why not just use an .INI file or simple TStringList with key-value pairs
that link the two ?   Then you can just leave the design-time stuff "as-is",
and do the switches at run-time.

--
Tim Young
Elevate Software
www.elevatesoft.com

Tue, Feb 5 2008 3:57 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Tim


>Why not just use an .INI file or simple TStringList with key-value pairs
>that link the two ? Then you can just leave the design-time stuff "as-is",
>and do the switches at run-time.

Its populating something of that nature that was the problem. I came up with a solution last night

1. drop an extra query component on the form
2. run a query against the configuration database and leave open
3. use query.database.session.getdatabasenames to populate a stringlist
4. loop round the stringlist and use query.database.session.finddatabase to get the xref
5. close the query

Feels a bit cacky but it works.

Roy Lambert
Image