Board index » delphi » Runtime creation of alias in BDE

Runtime creation of alias in BDE

Hi,

In a client/server app, if the dbadmin creates a new database, how can
he tell the client that there is a new database, making it create a new
alias in the BDE? It has to be done programmatically, because there
could be a big number of client.

Cheers

Manu

 

Re:Runtime creation of alias in BDE


On Wed, 10 Nov 1999 14:18:06 +0100, Emmanuel Ponette

Quote
<emmanuel.pone...@irislink.com> wrote:
>Hi,

>In a client/server app, if the dbadmin creates a new database, how can
>he tell the client that there is a new database, making it create a new
>alias in the BDE? It has to be done programmatically, because there
>could be a big number of client.

>Cheers

>Manu

If you have a database that will _always_ be present you could add a
table which contains a list of databases.

When the user logs in you could execute some code that performs as
below:

loop for each entry in database list
  check if the alias exists
  if alias does not exist
    create the alias
  if end
loop end

If the aliases followed a certain naming convention you could use
similar logic to run through the aliases known to the system, check if
there is a corresponding entry in the database list and remove the
alias if not found. This would ensure the aliases are cleaned up if
the dba deletes a database.

HTH

--
Gary Wilmot
Senior Developer
Vizual Business Tools Ltd
http://www.vizual.co.uk

Re:Runtime creation of alias in BDE


The DBlist table is a good idea. . .but you dont have to create a new alias:
using a tdatabase component, pointed to an exisiting AliasName (if its an
ODBC->BDE alias) or DriverName (if its an Native Driver like INTRBASE,
PARADOX, etc. . .)
1. close the database component. 2. set params to contain SERVER
NAME=[database name] 3. reopen the database

I use Native drivers where ever possible because it eliminates the need to
create aliases, just set the 'server name' = parameter in a tDatabase
component before opening

bas

Quote
> If you have a database that will _always_ be present you could add a
> table which contains a list of databases.

Re:Runtime creation of alias in BDE


The DBlist table is a good idea. . .but you dont have to create a new alias:
using a tdatabase component, pointed to an exisiting AliasName (if its an
ODBC->BDE alias) or DriverName (if its an Native Driver like INTRBASE,
PARADOX, etc. . .)
1. close the database component. 2. set params to contain SERVER
NAME=[database name] 3. reopen the database

I use Native drivers where ever possible because it eliminates the need to
create aliases, just set the 'server name' = parameter in a tDatabase
component before opening

bas

Other Threads