Free Address Book Logo

Can I change the default path of the database file?

Yes, a personal path (place) can also be given to the database file. Its advantage is that the user can replace its database to a path which is defined by it, and from this path a trusted save can be easily done from an already installed process.

The current version does not support moving of the database file through the user’s interface, (it is planned to realize it in a later version) it has to be performed by the user by editing of the configuration file of the programme.

The AddressBook.exe.config configuration file can be found in the folder, containing the programme itself. This is a simple, short text file, which can be opened and edited by any other editing programme of the Windows. (for example: Notepad)

Find the following text part:

connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:Documents and
Settings[user's folder]Application DataGAS SoftwaresFree Address Book
AddressBook_2.0.mdb"
The red part marks the database path. The same in the portable version is the following:

connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|
                    AddressBook_2.0.mdb"
The |DataDirectory| gives a signal to the programme that the database file can be found in the same file as the program itself. By rewriting of these paths our database file can be removed into any other folder of our computer. For example in the following case:

connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:FreeAddressBookAddressBook_2.0.mdb"
It is removed into the FreeAddressBook folder, which can be found in the D partition.

After rewriting the configuration file has to be saved. In the next step, our already existing database has to be copied into the previously given path, in case of an installer version:

C:Documents and Settings[user's folder]Application DataGAS SoftwaresFree Address Book
In case of a portable version, from the folder of the program. If a database file which could be copied into the new path has not existed, (for example because the program is installed for the first time, and we do not have a database) the program creates a new, empty database automatically. Of course, if it finds an already existing database on the path, it does not rewrites it but uses it.
Back