Subject Re: allowing user to change or add an alias
From Charlie <tm@tc.com>
Date Fri, 16 Jun 2017 20:40:45 -0400
Newsgroups dbase.getting-started

Hey.. Thanks very much.  I will study this!!

Akshat Kapoor Wrote:

> On 16/06/2017 04:16, Charlie wrote:
> > Hi... I have been fooling with bdealiasEX.cc and am trying to allow the user of my software to change the path to the database.  I have set the procedure to bdealiasex.cc (on open)  in a form I am using that has an entryfield defining the path that the user wants to use.  I am having trouble understanding how this works.  Could someone give me some guidance?
> >
> > Thanks!!
> >
> Hello Charlie,
> I have not used bdealiasEX.cc
> But I had at one time experimented with adding temprory alias.
> I have not implemented it but did check it out.
>
> The attached prg works fine. for testing just change the folder paths
> and table names to the ones you have on your computer. If you have any
> problem I can even send the tables to you.
>
> The approach I use to avoid hard coding of database paths is slightly
> different.
> At the start of the program I declare a object and store the path of
> database (this path is stored in a table in the program directory)as a
> property of the object. Then in the datamodule I use this property as
> part of the sql
>
> class inveDATAMODULE of DATAMODULE
>     this.VATRATE = new QUERY(this)
>     with (this.VATRATE)
>        left = 138.0
>        top = 19.0
>        sql = 'select recno,tax,vat,sat from "' +
> mcompany.direct+'\vatrate.dbf"'
>        active = true
>     endwith
>
> Hence I do not need database alias. Moreover path can be changed at will.
> This can be achieved in the form also but the form designer evaluates
> the expression and replaces the sql string with the evaluated string.
>
> So I use datamodules which are seldom opened.
>
> Regards
> Akshat
>