关于问题2,主要是跟权限设置有关,这个问题很早就有人问了,下面是borland公司的回答:
Q:
When using the BDE, I get the following error when starting my web application: "An error occurred while attempting to initialize the Borland Database Engine (error $2B05)"
A:
This is a setup issue, not a Delphi programming problem. Cause: This error happens because the anonymous user that IIS starts your process as does not have permission to write to some temp directories (Typically, for security reasons, it can't write to the directory where inetinfo.exe is located in your System32/inetsrv directory.)
Solution: The Paradox tables were not designed for multiple users hitting the database at the same time. The best solution is to use a SQL based database, such as Interbase, Oracle, or MS SQL Server.
If you must use Paradox and the BDE, then be sure to have a TSession on your WebDataModule. Set AutoSessionName to true. The key thing is to set the NetFileDir and PrivateDir to something that the anonymous IIS account can access. A good solution would be to set the NetFileDir to: C:/Temp/Net and the PrivateDir to: C:/Temp. The two cannot point to the same directory. In addition, it is best to uniquly set the PrivateDir for each webmodule, in the OnCreate event (typically, you will create a directory based on the current thread id, and set the PrivateDir to this). Otherwise, you may see each other's data from different threads. However, the NetDir MUST be shared across all processes and threads.
Next, you must give the IUSR_MACHINE_NAME and IWAM_MACHINE_NAME accounts full read and write permissions to the following directories:
1. The BDE directory
2. The base directory for your NetDir and PrivateDir
3. Your actual temp directory, probably C:/WINNT/Temp
4. Your directory that contains the database files
5. If all else fails, give read permissions to C:/WINNT, and then write permissions to C:/WINNT.