Solved

SQL database Access Denied for some reason I cannot figure out

Posted on 2008-10-08
13
232 Views
Last Modified: 2008-10-22
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
Comment
Question by:zhuansun
  • 6
  • 5
  • 2
13 Comments
 
LVL 39

Expert Comment

by:BrandonGalderisi
ID: 22673308
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
 

Author Comment

by:zhuansun
ID: 22673411
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
 
LVL 39

Expert Comment

by:BrandonGalderisi
ID: 22673433
so it was pulling from the global.asa file?  Have them verify the file is still there and still has the value.
0
 

Author Comment

by:zhuansun
ID: 22673539
IT WAS NOT PULLING FROM GLOBAL.ASA! I HARDCODED CONNECTIONSTRING IN ASP PAGE FILE.
0
 
LVL 42

Expert Comment

by:dqmq
ID: 22673821
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
 
LVL 39

Expert Comment

by:BrandonGalderisi
ID: 22675502
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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 

Author Comment

by:zhuansun
ID: 22677750
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
 
LVL 42

Expert Comment

by:dqmq
ID: 22682442
>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
 

Author Comment

by:zhuansun
ID: 22682587
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
 
LVL 39

Expert Comment

by:BrandonGalderisi
ID: 22683823
Stupid question, have you tried rebooting the web server or issuing an iisreset command?
0
 

Author Comment

by:zhuansun
ID: 22686268
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
 

Accepted Solution

by:
zhuansun earned 0 total points
ID: 22688919
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
 
LVL 39

Expert Comment

by:BrandonGalderisi
ID: 22688999
Awesome.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Foreword (May 2015) This web page has appeared at Google.  It's definitely worth considering! https://www.google.com/about/careers/students/guide-to-technical-development.html How to Know You are Making a Difference at EE In August, 2013, one …
Foolproof security solutions has become one of the key necessities of every e-commerce or Internet banking website. If you too own an online shopping site then its vital for you to equip your web portal with customer security features that can allow…
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
Learn how to set-up PayPal payment integration in your Wufoo form. Allow your users to remit payment through PayPal upon completion of your online form. This is helpful for collecting membership payments, customer payments, donations, and more.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now