||Re: allowing user to change or add an alias
||Sun, 18 Jun 2017 09:27:07 -0400
I tried this on my Windows 10 version 1607 64 bit computer at work and it does the same thing. (Dbase 10.3). Here is the exact code I am using. User is allowed to specify the path in a form which is connected to this program:
set procedure to :dUFLP:BDEAlias.cc
oBDE = new BDEAlias()
OBDE.DeleteAlias( "train" )
oBDE.CreateAlias( "train", cpath )
// where "PathToDatabase" would be the value from
// the entryfield you have on your form ...
release object oBDE
oBDE = null
close procedure :dUFLP:BDEAlias.cc
msgbox ( "Database TRAIN path changed to " +cpath+"." )
When you run the form it connects to this program. It does function. The first time you run it (if the alias already exists) dbase hangs up and never reaches the message box. But if you go into bde administrator the database is gone.
If you run it again it hangs up the same way but if you go into the bde administrator the database is there and the path correctly defined.
I don't think it is the code. There is just something goofy going on which is par for the course for me! :)
If anyone comes up with anything please let me know. I'm going to try to work on Akshat's alternate solution later today.
Think I'll post this in the dbase bug report as well.
Thanks for the help!!!
Ken Mayer Wrote:
> On 6/17/2017 8:21 AM, Mervyn Bick wrote:
> > On 2017-06-17 4:01 PM, Ken Mayer wrote:
> >> What are the permissions on that folder, or the IDAPI.CFG file? I
> >> don't know why mine doesn't do the same thing ...
> > Both the folder and the file have all the boxes, except Special
> > Permissions, ticked ie full control.
> > BDEAlias.deleteAlias() works properly.
> > BDEAlias.createAlias() does actually create the alias but control
> > doesn't return to dBASE.
> > What version of Windows are you using?
> Current version of Windows 10, 64-bit ...
> *Ken Mayer*
> Ken's dBASE Page: http://www.goldenstag.net/dbase
> The dUFLP: http://www.goldenstag.net/dbase/index.htm#duflp
> dBASE Books: http://www.goldenstag.net/dbase/Books/dBASEBooks.htm