Board index » delphi » add programmatically a New persistant alias in Bde configuration file

add programmatically a New persistant alias in Bde configuration file

Hi Bill,

I have a problem to add a New persistant alias in Bde configuration file.

Here is operations I do :

At first initialise bde environment :

dbiInit (Nil);

After :

ErrBde := DbiAddAlias (Nil, PAlias, szDBASE, PDir, True);

PAlias content is the name of the new alias.
PDir     content the directory of the new alias.

After execution of that function, I can see the new alias in the list of
aliases  with the bde administrator tool (bdeadmin.exe).

After : clear bde environment :

DbiExit;

After execution of that function, I can't see the new alias with the bde
administrator tool (bdeadmin.exe).

Is it why the property sesCFGUPDATE is not set to ON ?
If it's right, how to set it to ON ?

Could you help me ?

Thanks for advance

Michel Landrain
email : mland...@club-internet.fr

 

Re:add programmatically a New persistant alias in Bde configuration file


Hi,
I think, sesCFGUPDATE is set to ON by default, but function to modify props
is :

         DbiSetProp (hObj, iProp, iPropValue),
wher hObj is your session-object.

Katharina

Quote
Michel Landrain wrote:
> Hi Bill,

> I have a problem to add a New persistant alias in Bde configuration file.

> Here is operations I do :

> At first initialise bde environment :

> dbiInit (Nil);

> After :

> ErrBde := DbiAddAlias (Nil, PAlias, szDBASE, PDir, True);

> PAlias content is the name of the new alias.
> PDir     content the directory of the new alias.

> After execution of that function, I can see the new alias in the list of
> aliases  with the bde administrator tool (bdeadmin.exe).

> After : clear bde environment :

> DbiExit;

> After execution of that function, I can't see the new alias with the bde
> administrator tool (bdeadmin.exe).

> Is it why the property sesCFGUPDATE is not set to ON ?
> If it's right, how to set it to ON ?

> Could you help me ?

> Thanks for advance

> Michel Landrain
> email : mland...@club-internet.fr

Re:add programmatically a New persistant alias in Bde configuration file


Hi, I've tested a simple example, it works well :

 hDBISes hSes;
 DbiStartSession("testsession", hSes, "c:\"");
 res = DbiSetProp (hSes, sesCFGUPDATE, true);

 res = DbiAddAlias(NULL, "TESTALIAS", "Paradox","TESTPATH", TRUE);

Bye

Quote
Michel Landrain wrote:
> Hi Bill,

> I have a problem to add a New persistant alias in Bde configuration file.

> Here is operations I do :

> At first initialise bde environment :

> dbiInit (Nil);

> After :

> ErrBde := DbiAddAlias (Nil, PAlias, szDBASE, PDir, True);

> PAlias content is the name of the new alias.
> PDir     content the directory of the new alias.

> After execution of that function, I can see the new alias in the list of
> aliases  with the bde administrator tool (bdeadmin.exe).

> After : clear bde environment :

> DbiExit;

> After execution of that function, I can't see the new alias with the bde
> administrator tool (bdeadmin.exe).

> Is it why the property sesCFGUPDATE is not set to ON ?
> If it's right, how to set it to ON ?

> Could you help me ?

> Thanks for advance

> Michel Landrain
> email : mland...@club-internet.fr

Other Threads