Subject Embedded Database File on Network Share?
Author Jarrod Hollingworth
Hi All,

BACKGROUND
----------
I have an application which uses FB 1.5.2 embedded on Windows.

On first run it copies a fresh database file from the installation location
(C:\Program Files\...) to the users roaming application data folder,
typically C:\Documents and Settings\<Username>\Application
Data\<MyCompany>\<MyApplication>\, in an attempt to avoid any filesystem
permission problems (such as the user not having write access to C:\Program
Files).

This has worked great, until now.

PROBLEM
-------

A user complained that they were getting an error every time they run my
application. My application logged the error with the following message:

"Unable to complete network request to host "<Host>".
Failed to establish a connection.
The system cannot find the file specified."

I couldn't understand why it was talking about a network request and a host
when it should just be a local file so I whipped up a diagnostic program
which they ran and I found that it was trying to connect to the database
file located at:

\\<Host>\Users\<Username>\Application
Data\<MyCompany>\<MyApplication>\DB.fdb

They are a running in a domain environment where the users PC is WinXP Pro
SP2 with a Windows 2003 Server as the domain controller which allows for
roaming profiles. As it turns out their user profile is located on a network
share.

I retrieve the path for their database file from a call to
SHGetSpecialFolderPath with value CSIDL_APPDATA and append my company name
and application name folders.

QUESTIONS
---------
Is it possible to run FB embedded with a database file located on a network
share?

If not then I won't be able to allow a roaming database. I could pass
CSIDL_LOCAL_APPDATA to SHGetSpecialFolderPath to get the non-roaming path
(which _should_ be a local path) but if the user moves to another computer
(they would need to install my application on multiple computers) then their
database file won't move with them.

Regards,
Jarrod Hollingworth