Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 6 of 6 total
Thread How to open a new database in a different directory?
Mon, Nov 4 2013 5:50 PMPermanent Link

Barry

I may have stepped in it over the weekend and made a change to a table that now has the EDBSrvr.exe throwing an AV when I try and execute a Range on the table. I don't remember what the change was to the table so I through I would simply unzip the database (and config files) that I had backed up to a zip file, to a different directory and open it with EDBMgr.

Well, this seems to be more difficult that I first imagined. Even though I have the complete set of data files and config files, I see no way in EDBMgr to point it to the new directory and have it open the restored files.

Sure I can use EDBMgr to create a new session but that means I have to specify all of the customizations like file extensions and encryption password etc. and I'd only end up with an empty data directory with a new config file. I thought all I'd have to do is when I create a new session, select the Local tab and specify the File Folder that contains the unzipped config file and data directory, and it would be smart enough to realize "Hey, there already is a set of config files already in this directory, I'll just use that."  No such luck. Frown

What I want to do is point EDBMgr over to an existing directory that has all of the files already in it, and open the database. Why is that so difficult? Am I missing something?

TIA
Barry
Tue, Nov 5 2013 4:23 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Barry


I may be wrong but I think your problem is you're confusing session and database. The session will contain the customisation data and this information is only stored if the programmer comes up with a mechanism to do so. Its not included in the catalog.

So you can either create a news session and enter all of the customisations by hand or you can cheat. Guess what I prefer Smiley

To cheat find the ini file (mine is in C:\Documents and Settings\Roy Lambert\AppData\Local\Elevate Software\ElevateDB Manager\) open it up and copy an existing session (with all the customisations), change the Configuration Folder and bingo.

When you open the session you'll need to alter the database to make sure its pointing to the right place. That should do it.


Roy Lambert [Team Elevate]
Tue, Nov 5 2013 2:42 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Barry,

<< I may have stepped in it over the weekend and made a change to a table
that now has the EDBSrvr.exe throwing an AV when I try and execute a Range
on the table. I don't remember what the change was to the table so I through
I would simply unzip the database (and config files) that I had backed up to
a zip file, to a different directory and open it with EDBMgr. >>

Could you please send me a copy of the database/table files that are
throwing the AV, along with the range code, if you get a chance ?

Roy is correct - just go into the edbmgr.ini file, find the existing session
name ([Session_<SessionName>]) as a section identifier, copy it and
everything under it to the clipboard, paste it at the end of the edbmgr.ini
file, and then change the section name and Name/Configuration Folder keys.
When you re-open the EDB Manager, you'll have a new session that you can
play with as you see fit.

Thanks,

Tim Young
Elevate Software
www.elevatesoft.com
Wed, Nov 13 2013 5:34 PMPermanent Link

Barry

>Roy is correct - just go into the edbmgr.ini file, find the existing session
name ([Session_<SessionName>]) as a section identifier, copy it and
everything under it to the clipboard, paste it at the end of the edbmgr.ini
file, and then change the section name and Name/Configuration Folder keys.
When you re-open the EDB Manager, you'll have a new session that you can
play with as you see fit.<

I'll pass those instructions on to my client. VBG

Does it have to be this difficult?

Let's say I zip up a directory containing a database and its cfg files and send it to the client to unzip. I'd the client to be able to run a command line program that I give him that would register that database for that directory. The program would supply any missing information (like password etc.) by reading an ini file or from some other file that I put in the new database directory.

Another options would be EDBMgr to have a File > Register Database option that would do the same thing but with a GUI interface. If the ini file is not found in the new database directory, then the user would have to fill in any missing options.

I think this feature would come in handy when registering (or unregistering) databases. What do you think?
With the information you and Roy have provided, I can certainly roll my own application to do this, but most databases have this feature built in and doesn't require the client to edit ini files.

Just my 2 cents. Smile

Barry
Thu, Nov 14 2013 3:49 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Barry


>I'll pass those instructions on to my client. VBG

Considering the amount of damage that can result it is inadvisable to provide a client with EDBManager.

>Does it have to be this difficult?

If you use EDBManager it should not be considered difficult. If the person finds this difficult then they shouldn't be using EDBManager.

>Let's say I zip up a directory containing a database and its cfg files and send it to the client to unzip. I'd the client to be able to run a command line program that I give him that would register that database for that directory. The program would supply any missing information (like password etc.) by reading an ini file or from some other file that I put in the new database directory.

Its not difficult to do programmatically for an application. It could be done totally within EDBManager - look at Create Copy of Session - change the file folder in Local -  follow that up with altering the database to point to the new path and it should work. I just gave you the easy option Smiley

>Another options would be EDBMgr to have a File > Register Database option that would do the same thing but with a GUI interface. If the ini file is not found in the new database directory, then the user would have to fill in any missing options.

Err - what ini file?

>I think this feature would come in handy when registering (or unregistering) databases. What do you think?

I think you're confusing sessions and databases.  A session can have lots of databases connected to it. In my case there are generally only two - the on disk stuff (ie the real data) and an in-memory database.

>With the information you and Roy have provided, I can certainly roll my own application to do this, but most databases have this feature built in and doesn't require the client to edit ini files.

You're now extending my answer which was the easy way to hook up a restored database in EDBManager to how to connect sessions (even though you just keep saying database) and databases in your application. The two things are totally different. The stored session information is in the configuration file (default EDBConfig.EDBCfg). That holds comparatively little.  Other stuff (eg encryption key, user id, password, customisations - look in EDBManager's ini file for the full list) is your responsibility. Where and how you store that session information for your application is your decision. Some of it will be in the session component some may be in an ini file that you supply, some will be defined by user input.

To give an example from an app of mine. There is an ini file containing one line - the path to the configuration file. On start up the executable checks to see if EDBConfig.EDBCfg is in its own directory and if so uses it, if not it checks for the existence of the ini file and if it exists it loads it and uses that to set the configuration path. If neither are there it panics!

The user ID and password are provided by the user typing them in.

The encryption key is retrieved from a hidden place in the app.

Roy Lambert [Team Elevate]
Wed, Nov 20 2013 2:21 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Barry,

<< I'll pass those instructions on to my client. VBG

Does it have to be this difficult? >>

Actually, no - as Roy indicates, I forgot that there's a Create Copy of
Session task when you select an existing session node in the EDB Manager.
Use that instead.

<< Let's say I zip up a directory containing a database and its cfg files
and send it to the client to unzip. I'd the client to be able to run a
command line program that I give him that would register that database for
that directory. The program would supply any missing information (like
password etc.) by reading an ini file or from some other file that I put in
the new database directory.

Another options would be EDBMgr to have a File > Register Database option
that would do the same thing but with a GUI interface. If the ini file is
not found in the new database directory, then the user would have to fill in
any missing options.

I think this feature would come in handy when registering (or unregistering)
databases. What do you think? >>

The EDB Manager is an *interactive* tool.  It's not intended to be used for
automating the addition of databases with your client applications, other
than to write the actual scripts that do such tasks.  What I would recommend
is that you write a little utility to handle automatically updating the EDB
Manager's edbmgr.ini file as necessary, based upon your needs.  It can be as
simple as a batch file that concatenates an incoming .ini file containing
the relevant session information with the existing edbmgr.ini file.

Tim Young
Elevate Software
www.elevatesoft.com
Image