I am trying to debug one application which has mostly .aspx and .cs pages and the database behind it is an oracle SQL Developer database.
The whole application runs fine but it crashes on launching pages with .asp extension.
Below is the error:
"ADODB.Connection error '800a0e7a'
Provider cannot be found. It may not be properly installed.
After Googling I did enable ASP checkbox in Windows ADD/remove features.
Also, I tried changing Pipeline to classic and enabled 32-bit mode in the application pool of IIS server, but then the whole application stopped running in Visual Studio.
I had also created an odbc DNS driver in ODBCAD32.
Everything works fine but only crashes with .asp pages.
The error message says it all, ADODB cannot open database given in the connection string. Typically, classic asp must have the connection string somewhere in its code and it does not read the web.config file, which is for asp.net. To troubleshoot, open the source code of the failed asp page, find where it calls database, and check the connection string. It might happen that asp used "includes" and the connection string was defined in a different file, specified in <!--#include file="..."-->
Examples of connection string to Oracle can be seen here.
Related
I created a simple ASP.Net Core application with user authentication (so all the Entity Framework has been preloaded into the web app template). It is connecting to my database with the connectionString that is located in my appsettings.json file, with "data source = {computerName}\\{serverName}" setup.
The database instance and Visual Studio are located on the same machine. This works fine in returning data to the web api while within development and debugging mode. When I publish it and try to go to the site from a domain name it does allow me to view the webpages that are not needing database connection but the rest that need data from the database returns pages like this:
Error.
An error occurred while processing your request.
Development Mode
Swapping to Development environment will display more detailed information about the error that occurred.
Development environment should not be enabled in deployed
applications, as it can result in sensitive information from
exceptions being displayed to end users. For local debugging,
development environment can be enabled by setting the
ASPNETCORE_ENVIRONMENT environment variable to Development, and
restarting the application.
I have tried to change the Environment Variables for ASPNETCORE_ENVIRONMENT from Development to Production to no success.
I have tried adding appsettings.Production.json to publishOptions in my project.json file, even though there is no file appsettings.Production.json, and this did not help. dotnet publish
Adding the evironment variable in the web.config file did not work Deployment
I need help getting the published web api to connect to my SQL Server database from outside the development Visual Studio setup.
The last thing I can think of is that maybe I am incorrect in how I understand the connection string. If the web api uses the connection string to connect to the database from the server-side then it should work just fine like it does when in development calling to http://localhost:port# since it's all on the same machine. But, if the database string needs to be based on a client-side call then it would have to be with domain names and IP addresses.
Can someone tell me which one it is?
The only thing else that comes to mind is that there is something I am not doing, and need to do, inside of IIS Manager. I see connect string there as well but unsure what that is for our does since the connection string is inside the application. Also maybe I am suppose to give the app some kind of authorization to communicate with the database server even though they are on the same machine???
After much research, finally googling "how to deploy a web api in iis" I was able to learn from Host ASP.NET Web API in IIS using Visual Studio Publish that I needed to add the security entity BUILTIN\IIS_IUSRS. Then placing a mapping to my database tables and giving db_datareader (and possibly db_datawriter) for the database to the IUSER to allow access from my self hosted IIS web api. This from the above mentioned link with the part stating
Accessing Database under IIS APPPOOL\ASP.NET v4.0
As we are using ASP.NET v4.0 App Pool make sure IIS APPPOOL\ASP.NET v4.0 is added to your Database Server -> Security -> Logins.
I have an ASP.NET MVC5 web application that was originally created using VS2013 and uses Entity Framework 6 Code First, with data migrations. It has been working fine (in production) for almost a year and has been re-deployed numerous times, from Visual Studio, using Web Deploy.
Today, I opened the solution in VS2015 and redeployed a known working version of the codebase to production without any problems. However, after deployment, the production website suffered from the problems described in this article, which I solved by applying author's the recommended fixes.
After applying these fixes, I now have a new problem: an exception that suggests that the application is trying to access the database using the wrong connection string:
Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed.
Within the details of the exception page, the cause of the problem is clarified:
The connection string specifies a local Sql Server Express instance using a database location within the application's App_Data directory.
I'm puzzled by this because the application has a dedicated SQL Server instance that is accessed using a regular connection string. I've checked the Web.config generated by Web Deploy and it seems to be intact. It contains a named connection string that correctly references the production SQL Server instance, and the code (which hasn't changed) correctly instantiates an Entity Framework ApplicationContext using the named connection string.
Does anyone have any idea why this application now expects to create its own SQL Server instance or what I can do to debug this problem?
Many thanks for your suggestions,
Tim
A few things you can try before making the web deploy:
Check if the project that contains the connection string declaration (web.config) is setted as the 'startup project'.
Rebuild the solution in release mode.
In the Publish Web wizard, in Settings, expand File Publishing Options and check 'Remove additional files at destination' and 'Exclude files from App_Data folder'
I have two apps that use the Microsoft.ACE.OLEDB.12.0 provider to open Excel files on the same machine. One routine is a c# compiled app that works fine..the other is a non-compiled asp.net app that uses vb code behind that we are trying to re-host that throws 'The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.' errors when opening the Excel file - which appears to me to be bogus since the other app runs fine on the very same machine. I have checked the app pools for both and they appear to be set up identically...they both have 32 bit checked and are using the same .Net framework version. The web.config for both of them has the same connection string with the same options (only difference is the name of the connection)..We even re-installed the dll. I tried copying the dll to the bin folder for the aspnet app, but no luck there either. I would compile the asp.net app, except it uses ColdFusion for part of its output... I am hoping there is someone out there that has run into this particular issue and might have some pointers on where to look to solve this... Or maybe a different direction?
I have a web app which is working fine in IIS 6 ex:loading page, loading doc and excel file perfectly. recently I moved the same web app code ti windows server 2008 R2 IIS 7. Now it is not working correctly, it is browsing but it is not loading the Excel and doc files properly.
Additonal Trouble Shooting Info
Adding to the above when i checked the event viewer i am getting below information
The description for Event ID 0 from source Quotes cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.
If the event originated on another computer,
the display information had to be saved with the event.
The following information was included with the event:
Class : GetFile Method : Page_Load An unexpected error has occurred
while locally saving the requested file. Error details - Object
reference not set to an instance of an object. the message resource is
present but the message is not found in the string/message table
could you please help on this. how to find the root error and how to trouble shoot further.
This is a long shot but we had an issue where we used to parse data Excel worksheets using Microsoft.JET.OLEDB.4.0
This started to throw errors on an Application hosted within IIS7 but was fine in IIS6.
Our fix was to:
Right click the Application Pool being used by the Web App
Advanced Settings
Set Enable 32-Bit Applications to True
If that fails to help, why not try to use the Classic .NET AppPool with your application, as opposed to the DefaultAppPool (which I am assuming is the case).
Good luck!
I just created my first ASP.NET Version 4 app using Visual Studio 2010 and SQL Express 2008.
I copied the files to IIS and run the default.asp. This loads the programs main menu. So far so good.
When I open the read webform and do a read of my database I get the following Error:
Server Error in '/Diary' Application.
Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed.
Any idea how to fix this error?
Did you look at support articile for the very issue.
Or even this