This project has moved and is read-only. For the latest updates, please go here.

Determine location of all database files

Jan 9, 2013 at 2:50 PM

I really like to keep the log files of my ESE database with the main file in one place.  Is there a way to tell the system to keep them together?

Exampe:  I have a sub-folder called "C:\myProgName\Bin\ESEdatabase" that holds the main database file with the extension of .edb.

However all the log files are stored in "C:\myProgName\Bin" folder.  The "Bin" folder is the starting point of the program execution.  I would like to tell the system to keep all database related files in "ESEdatabase" folder.

Can you suggest a way?



Jan 17, 2013 at 12:43 PM

InstanceParameters.SystemDirectory, InstanceParameters.TempDirectory, and InstanceParameters.LogFileDirectory.

Yes, it's annoying that you have to set multiple system parameters. It's for historical reasons (i.e. they might not make much sense now :).


Jan 17, 2013 at 3:10 PM


Thank you very much for the reply.  This is a fantastic product and you are very nice to answer all these questions.  The following code is an example for anyone that needs code sample:

            instance = new Instance("DatabaseNameHere");

            Directory = "SubFolderName";
            instance.Parameters.LogFileDirectory = Directory;
            instance.Parameters.TempDirectory = Directory;
            instance.Parameters.SystemDirectory = Directory;
            instance.Parameters.CreatePathIfNotExist = true;

            // Create the instance, database and table

Also look at discussion for better example.