• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 243
  • Last Modified:

SQL database Access Denied for some reason I cannot figure out

I left my previous company 9 monthes ago, and the ASP applications I wrote were working fine.
Recently, they called me that some applications had error message like :

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Microsoft OLE DB Provider for SQL Server error '80004005'
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.
/testsldn.asp, line 32
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

The ASP applications run under the web server and SQL server in the same computer within conpany's network.

I setup the same ASP application in my home computer with the same connection string to remotely connect to the same SQL database., and there was no problem at all.

As I know, the company's SQL server and IIS settings never changed, but Network security settings may be updated by LAN people from other company.

Right now, under the web server, some ASP applications still work fine, some have SQL connection problem.

Some strange things to me are: In one application's root folder, a previously created page to load data from SQL database has no problem. However, the another newly created test page in the same folder with the same connection string has problem.

I am not the Network configuration person. I don't know how to track and fix the problem. Any suggestion would be greatly appreciated.
0
zhuansun
Asked:
zhuansun
  • 6
  • 5
  • 2
1 Solution
 
BrandonGalderisiCommented:
Perhaps:

If your connection string was stored in a global.asa file, it may have lost it.  I've had this happen.  Especially when virtual directories are messed with.

I would recommend having them put a response.write of the connection string before it attempts to open the connection to ensure a valid connection string is being used.
0
 
zhuansunAuthor Commented:
For testing purpose, I just hardcoded the connection string in asp page file.

The ponit is the same testing page in my local web site works fine, I just email that page to my previous company and asked them to put in the application folder to test.
0
 
BrandonGalderisiCommented:
so it was pulling from the global.asa file?  Have them verify the file is still there and still has the value.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
zhuansunAuthor Commented:
IT WAS NOT PULLING FROM GLOBAL.ASA! I HARDCODED CONNECTIONSTRING IN ASP PAGE FILE.
0
 
dqmqCommented:
So, the connection string has a servername or IP address and a userid and a password.   Try connecting from ManagementStudio using the same combination.   Resolution of the Server Name could be confused.
0
 
BrandonGalderisiCommented:
no need to use the CAPS, but when you said "For testing purpose, I just hardcoded the connection string in asp page file.", it is not unreasonable to assume that PRIOR to this test that it was not set in the asp.  The logical place is in the asa file.
0
 
zhuansunAuthor Commented:
What is 'ManagementStudio'?
I tried the connectionstring contains servername first, then IP address, and always contains username and password. none is work. But it always works when the web application is setup in my local computer with the comnnectionstring contains IP address.



0
 
dqmqCommented:
>What is 'ManagementStudio'?

Management Studio is the GUI front end for database administration.  It should be in the Start Menu on the machine where SQL Server is installed.  (You can also install it as a client, but we want to keep it simple for now).  When you start up that app, you are prompted for a ServerName, userid, and password.  In effect, you avoid application layers and talk almost directly with the database.  Sometimes the error messages are more meaningful.  
0
 
zhuansunAuthor Commented:
Sorry to have asked the stupid question. In fact, I used it almost everyday. There is no any problem to connect to the SQL server either from inside company's network or from outside company's network through internet connection with the same SQL server IP address, username and password. I also have desktop application to use the same connection string to connecti to the same SQL database. There is no problem at all.

I don't think it is connection string problem. That connection string has been used for many years.

I just don't know how to start to check network settings and/or SQL server settings and/or IIS settings.

The IIS is version 6.0. SQL server version is 2005.

0
 
BrandonGalderisiCommented:
Stupid question, have you tried rebooting the web server or issuing an iisreset command?
0
 
zhuansunAuthor Commented:
No, I couldn't do it because I no longer work for that company. They laid off me last year. Now, beside my permanent job, I just work as a part-time contractor for them to maintenance those web applications. I will suggest them to reboot the web server and SQL server (both are installed in the same machine). I guess they already did it when that problem happened three weeks ago.

Thanks
0
 
zhuansunAuthor Commented:
Problem fixed by an network expert in a local tech firm.
That problem was caused by recent change of Network firewall setting.
The connection string was using SQL server's public IP address and Network settings could handle it. Since new Network settings no longer handle it, and the external IP address only exists in firewall, the connection couldn't be made. After changing the public IP address to the hostname of server, everything is OK now.

Thanks
0
 
BrandonGalderisiCommented:
Awesome.
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

  • 6
  • 5
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now