The main program files for the windows application will by default be installed to c:\program files\mgcs2005. You may select to install these files to a different folder, however, we recommend accepting the defaults. The database file, named mgcsdata.mdb, will by default be installed to c:\inetpub\wwwroot\db. If using the web interface, the folder where the data files are accessed will need to be shared with special permissions for the web interface to work. I recommend using a database off the web root, normally c:\inetpub\wwwroot, to simplify setting permissions. If you later set up another program which is similar to MGCS 2005, you will already have a folder to place the database file which has these settings in affect.
Many of you will purchase a site license for MGCS 2005 and there may only be one user of the windows and pocket pc application - yourself. However, others may have several staff member and in addition to access via the web pages, you may want more than one person using the desktop application as well. How do you install the program for this situation? Just accept the defaults. This will initially place one copy of the database on each workstation in c:\inetpub\wwwroot\db then share the folder on one PC with the other PC mapping a drive letter to that shared /db folder. The user(s) who now are connecting to the shared folder would go to the Control Panel, ODBC applet and configure the system DSN named MGCS2DATA to point to the newly mapped drive letter. In the example screen shot, I have mapped K: to the c:\inetpub\wwwroot\db folder on another PC.
Unlike static web pages, when a web application is used that interacts with a database, a special built in user account (IUSR_machinename) will need to have read/write permissions to the folder where the database is stored. If that account does not have proper permissions to the database and folder, whenever anyone browses the web pages that interact with the database they will get errors.
When viewing the page in Live Page mode or when trying to view a page after publishing
it to the web server, the web browser displays any of the following errors:
* Microsoft JET Database Engine (0x80004005) Could not use ''; file already in use.
* Microsoft OLE DB Provider for ODBC Drivers error '80004005' [Microsoft][ODBC Microsoft Access 97 Driver] Couldn't use '(unknown)'; file already in use.
* Microsoft OLE DB Provider for ODBC Drivers (0x80004005) [Microsoft][ODBC Microsoft Access Driver] The Microsoft Jet database engine cannot open the file '(unknown)'. It is already opened exclusively by another user, or you need permission to view its data.
* Operation must use an update able query. (Microsoft JET Database Engine)
Cause
This error usually happens on Windows NT, Windows 2000 or Windows XP and may be caused by any of the following conditions:
- the database file or database folder doesn't have necessary security permissions to write to, or erase an .ldb file created by Microsoft Access when opening the database
- the database file doesn't have sufficient security permissions or write permissions to be modified when updating data in it. The web browser is seen by the web server as a Internet User that has the server account IUSR. This user needs to have write permission to the database file and to the database folder.
Resolution
Follow these steps to resolve this issue:
1. Use Windows Explorer to find the folder on the disk, which contains the database file (.mdb). This is usually your project folder.
2. Right-click on the project folder and select Properties.
3. Uncheck the Read-only property.
4. Click on the Security tab in the properties window.
(Attention: If you don't see such tab (Windows XP), close the properties window, open any folder, select Tools -> Folder Options -> View, and uncheck the option Use simple file sharing.)
5. Click Add and find, then select the user IUSR_<COMPUTERNAME>.
6. Select the Write check box in the Allow; column to assign Write permissions to the IUSR account.
While both the desktop application and the pocket PC applet use an ODBC DSN for their connection to the database, the web application connects to the .mdb file by path. This path is specified in the common.asp file and if possible you will want to accept the default. However, there may be reasons why you don't want to have the .mdb file stored there, for example you may be one that has IIS installed on D: so you would want the web pages installed to D:\inetpub\wwwroot\mgcs2005. Just copy the .mdb file to the directory on the web server you want and edit the common.asp file to point to the new location (I always recommend using only Notepad.exe or other plain text editor for modifying the .asp files).