A precompiled web site is uploaded to the default web site environment. The login.aspx page accepts a username and a password and passes these to a server side aspx.vb Page_Load which gets a Jet4 accesss database configuration string from web.config and
attempts to open it using System.Data.OleDb as in the following greatly simplified code.
Using Conn As OleDbConnection = New Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\TEManager\EMData.mdb")
Try
Conn.Open()
Catch e As Exception
Msgbox e.message
End Try
End Using
The Conn.Open() line produces an Unspecified error.
This code and web site works well on the development machine which is XPPro as well as a different Windows 2003 server running IIS.
The site will not compile on this machine but if it is compiled on the development machine it will bring up the login screen.
Running the uncompiled site will produce an unhandled exception indicating some sort of error related to the compilation process.
In an attempt to get the site to compile I have reinstalled .Net Framework 3.5 SP1 but that did not help.
All machines have the latest updates which include up to .Net Framework 3.5 SP1.
The database does not require authentication and will open normally with read only access although the IIS_WPG and IUSR accounts have write access to this mdb file for application purposes.
I wonder if anyone on this forum has experienced anything like this.
I appologize for the sloppy original message, I need to learn a bit more about how to post code on this forum.
The way the database is opened and the state of the connectionString might be improved but the way it is done now does work well in other environments. The error generated by the conn.Open() line is logged as "Unspecified error".
The database is not located in the same location as the web site files and cannot be relative to the root. However, both locations have the same security permissions on the server and should be equally accessible to IIS.
There is something wrong with this server in that it does not compile this site and I suspect the two conditions (site wont compile and cannot connect to database) are related. Please see the resulting error page generated when the site in compiled on first
load on this server. Is it possible that system.data.dll is different in some way so that the conn.Open() command will work on one machine but not another?
The version on the XPPro development computer is 2.0.50727.3053
The version on the W2K test server that does not work is also 2.0.50727.3053
but the same file on the working W2K production server is version 2.0.50727.1433
Sounds like a dead end... what other version differences might have an effect?
Server Error in '/' Application.
--------------------------------------------------------------------------------
Timed out waiting for a program to execute. The command being executed was "C:\WINDOWS\Microsoft.NET\Framework\v3.5\vbc.exe" /noconfig @"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\17389c28\44b4e478\_ehsty4x.cmdline".
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Runtime.InteropServices.ExternalException: Timed out waiting for a program to execute. The command being executed was "C:\WINDOWS\Microsoft.NET\Framework\v3.5\vbc.exe" /noconfig @"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\17389c28\44b4e478\_ehsty4x.cmdline".
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[ExternalException (0x102): Timed out waiting for a program to execute. The command being executed was "C:\WINDOWS\Microsoft.NET\Framework\v3.5\vbc.exe" /noconfig @"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\17389c28\44b4e478\_ehsty4x.cmdline".]
System.CodeDom.Compiler.Executor.ExecWaitWithCaptureUnimpersonated(SafeUserTokenHandle userToken, String cmd, String currentDir, TempFileCollection tempFiles, String& outputName, String& errorName, String trueCmdLine) +2062
System.CodeDom.Compiler.Executor.ExecWaitWithCapture(SafeUserTokenHandle userToken, String cmd, String currentDir, TempFileCollection tempFiles, String& outputName, String& errorName, String trueCmdLine) +122
System.CodeDom.Compiler.CodeCompiler.Compile(CompilerParameters options, String compilerDirectory, String compilerExe, String arguments, String& outputFile, Int32& nativeReturnValue, String trueArgs) +195
Microsoft.VisualBasic.VBCodeGenerator.FromFileBatch(CompilerParameters options, String[] fileNames) +466
System.CodeDom.Compiler.CodeCompiler.System.CodeDom.Compiler.ICodeCompiler.CompileAssemblyFromFileBatch(CompilerParameters options, String[] fileNames) +197
System.CodeDom.Compiler.CodeDomProvider.CompileAssemblyFromFile(CompilerParameters options, String[] fileNames) +25
System.Web.Compilation.AssemblyBuilder.Compile() +775
System.Web.Compilation.BuildProvidersCompiler.PerformBuild() +71
System.Web.Compilation.CodeDirectoryCompiler.GetCodeDirectoryAssembly(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories, Boolean isDirectoryAllowed) +8809466
System.Web.Compilation.BuildManager.CompileCodeDirectory(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories) +128
System.Web.Compilation.BuildManager.CompileCodeDirectories() +265
System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +320
[HttpException (0x80004005): Timed out waiting for a program to execute. The command being executed was "C:\WINDOWS\Microsoft.NET\Framework\v3.5\vbc.exe" /noconfig @"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\17389c28\44b4e478\_ehsty4x.cmdline".]
System.Web.Compilation.BuildManager.ReportTopLevelCompilationException() +58
System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +512
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters) +729
[HttpException (0x80004005): Timed out waiting for a program to execute. The command being executed was "C:\WINDOWS\Microsoft.NET\Framework\v3.5\vbc.exe" /noconfig @"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\17389c28\44b4e478\_ehsty4x.cmdline".]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +8890735
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +85
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +259
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.3082; ASP.NET Version:2.0.50727.3082
The database does not require authentication and will open normally with read only access although the IIS_WPG and IUSR accounts have write access to this mdb file for application purposes.
You say they have write access to this mdb. It should be MODIFY permissions that must be set! Also make sure that's the right user you give permissions, read this:
RobertGMille...
Member
20 Points
36 Posts
IIS Can't open access database.
Jul 08, 2009 11:02 PM|LINK
Windows Server 2003 with latest updates.
A precompiled web site is uploaded to the default web site environment. The login.aspx page accepts a username and a password and passes these to a server side aspx.vb Page_Load which gets a Jet4 accesss database configuration string from web.config and attempts to open it using System.Data.OleDb as in the following greatly simplified code.
Using Conn As OleDbConnection = New Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\TEManager\EMData.mdb") Try Conn.Open() Catch e As Exception Msgbox e.message End Try End UsingThe Conn.Open() line produces an Unspecified error.
This code and web site works well on the development machine which is XPPro as well as a different Windows 2003 server running IIS.
The site will not compile on this machine but if it is compiled on the development machine it will bring up the login screen.
Running the uncompiled site will produce an unhandled exception indicating some sort of error related to the compilation process.
In an attempt to get the site to compile I have reinstalled .Net Framework 3.5 SP1 but that did not help.
All machines have the latest updates which include up to .Net Framework 3.5 SP1.
The database does not require authentication and will open normally with read only access although the IIS_WPG and IUSR accounts have write access to this mdb file for application purposes.
I wonder if anyone on this forum has experienced anything like this.
Thanks in advance.
IIS 6.0 Database access.
chandu2chand...
Participant
1158 Points
261 Posts
Re: IIS Can't open access database.
Jul 09, 2009 05:30 AM|LINK
Hi Robert G Miller,
Can you post your error details that you received. It's difficult to analyze with out telling what the exact error that you have received.
[Albert Einstein]
Regards,
Chandu
nileshdeokar
Participant
1148 Points
195 Posts
Re: IIS Can't open access database.
Jul 09, 2009 05:37 AM|LINK
web server don't know static pata as "E:\TEManager\EMData.mdb"
try to keep database file in same folder and try to access using relative location as EMData.mdb
else
you can use mysql database as it is free you have to just download it and use
chandu2chand...
Participant
1158 Points
261 Posts
Re: IIS Can't open access database.
Jul 09, 2009 07:25 AM|LINK
Yes, Nileshdeokar is right. You need to provide relative path for IIS instead of Physical path.
[Albert Einstein]
Regards,
Chandu
hans_v
All-Star
35986 Points
6550 Posts
Re: IIS Can't open access database.
Jul 09, 2009 09:20 AM|LINK
Really? Strange because it works for me, and also many others....
But without the error, it is hard to guess what the problem is!
nileshdeokar
Participant
1148 Points
195 Posts
Re: IIS Can't open access database.
Jul 09, 2009 10:36 AM|LINK
alternatively you can see above link:
http://www.aspfree.com/c/a/Microsoft-Access/Connecting-to-a-Microsoft-Access-database-with-ASPNET/
hans_v
All-Star
35986 Points
6550 Posts
Re: IIS Can't open access database.
Jul 09, 2009 02:04 PM|LINK
I just noticed:
"Porvider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\TEManager\EMData.mdb"
Porvider should off course be Provider
RobertGMille...
Member
20 Points
36 Posts
Re: IIS Can't open access database.
Jul 09, 2009 02:25 PM|LINK
Thank you all for your replies,
I appologize for the sloppy original message, I need to learn a bit more about how to post code on this forum.
The way the database is opened and the state of the connectionString might be improved but the way it is done now does work well in other environments. The error generated by the conn.Open() line is logged as "Unspecified error".
The database is not located in the same location as the web site files and cannot be relative to the root. However, both locations have the same security permissions on the server and should be equally accessible to IIS.
There is something wrong with this server in that it does not compile this site and I suspect the two conditions (site wont compile and cannot connect to database) are related. Please see the resulting error page generated when the site in compiled on first load on this server. Is it possible that system.data.dll is different in some way so that the conn.Open() command will work on one machine but not another?
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.data.dll
The version on the XPPro development computer is 2.0.50727.3053
The version on the W2K test server that does not work is also 2.0.50727.3053
but the same file on the working W2K production server is version 2.0.50727.1433
Sounds like a dead end... what other version differences might have an effect?
RobertGMille...
Member
20 Points
36 Posts
Re: IIS Can't open access database.
Jul 09, 2009 02:32 PM|LINK
Good observation Hans,
I double checked: the ConnectionString in web.config is correct. This was a typo in the original message which I corrected.
As I mentioned earlier, this web site works well on two other environments. XPPro and Windows Server 2003.
hans_v
All-Star
35986 Points
6550 Posts
Re: IIS Can't open access database.
Jul 09, 2009 02:44 PM|LINK
You say they have write access to this mdb. It should be MODIFY permissions that must be set! Also make sure that's the right user you give permissions, read this:
http://www.mikesdotnetting.com/Article.aspx?ArticleID=74