I have migrated a classic ASP site to a new server and am getting the following error, message.
I have tried different connection strings but none of them work.
I am not even sure if the connection string is the problem
The new server is a Windows 2012 Server, SQL Server 2008 R2 Express machine.
Microsoft OLE DB Provider for SQL Server error '80004005'
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.
/scripts/dbcode.asp, line 31
Application("C2M_ConnectionString") = "Provider=SQLNCLI10;Server=(local);Database=mysite_live;Uid=mysitec_Live;Pwd=mypass;"
Hiten004
2,4171 gold badge22 silver badges34 bronze badges
asked Feb 28, 2013 at 2:52
9
If it is an Express instance, it is most likely not a default instance, but rather a named instance. So you probably meant:
... "Provider=SQLNCLI10;Server=.SQLEXPRESS; ...
--- instead of just (local) ---^^^^^^^^^^^^
Otherwise you’ll need to show us the server properties in SQL Server Configuration Manager on that machine in order for us to be able to tell you how to correct your connection string.
answered Feb 28, 2013 at 3:27
Aaron BertrandAaron Bertrand
271k36 gold badges465 silver badges486 bronze badges
3
As Aaron Bertrand mentioned it would be interesting to have a look at your connection properties (In Sql Server configuration check if the following are enabled Name Pipes and TCP/Ip).
Since you’re able to connect from SSMS i would ask to check if the Remote connection is allowed on that server Also can you tell is the Sql browser service is running?
here is a link that i keep close to me as a reminder or check list on probable connection issues on SQL Server.
Sql Connection Issues
And lastly can you try as provider «SQLNCLI» instead of «SQLNCLI10»
answered Mar 4, 2013 at 23:02
Raymond ARaymond A
7631 gold badge12 silver badges29 bronze badges
2
Step-1: Enabling TCP/IP Protocol
Start >> All Programs >> Microsoft SQL Server >> Configuration Tools >> SQL Server Configuration Manager >> SQL Server Network Configuration >> Protocols for MSSQLSERVER >> right click “TCP/IP” and select “Enable”.
Step-2: change specific machine name in Data Source attributes’value to (local) will resovle the problem ni SQL SERVER 2012.
answered Sep 28, 2014 at 16:31
Try pinging the server in your connection string. The server your application resides on should be able to communicate on the port you specify by credentials. If you are developing locally try specifying «localhost». If the server is clustered or you installed as an instance then you need to specify that instance. Also make sure the server is configured for mixed-mode authentication if using sql credentials.
OR Try
Data Source=localhost;Initial Catalog=DBNAME;Persist Security Info=True;User ID=MyUserName; Password=MyPassword;
answered Feb 28, 2013 at 3:00
Ross BushRoss Bush
14.6k2 gold badges31 silver badges55 bronze badges
3
It can be a permission issue , Please check is that server is connecting with same configuration detail from SQL management.
other is username / password is wrong.
answered Feb 28, 2013 at 12:00
Jinesh JainJinesh Jain
1,2329 silver badges22 bronze badges
5
Here is what I would do:
EDIT: Note that this SO post, a few down, has an interesting method for creating the correct connection string to use.
- Open SSMS (Sql Server Management Studio) and copy/paste the
username/password. Don’t type them, copy/paste. Verify there isn’t
an issue. - Fire up the code (this is next for me b/c this would be the next
easiest thing to do in my case) and step to line 31 to verify that
everything is setup properly. Here is some info on how to do
this. I understand that this may be impossible for you with this
being on production so you might skip this step. If at all possible
though, I’d set this up on my local machine and verify that there is
no issue connecting locally. If I get this error locally, then I
have a better chance at fixing it. - Verify that Provider=SQLNCLI10 is installed on the production
server. I would follow this SO post, probably the answer posted
by gbn. - You have other working websites? Are any of them classic asp? Even
if not, I’d compare the connection string in another site to the one
that you are using here. Make sure there are no obvious differences. - Fire up SQL Server Profiler and start tracing. Connect to the site
and cause the error then go to profiler and see if it gives you an
additional error information. - If all of that fails, I would start going through this.
Sorry I can’t just point to something and say, there’s the problem!
Good luck!
answered Mar 5, 2013 at 14:08
Mike C.Mike C.
3,0042 gold badges20 silver badges18 bronze badges
5
Have you ever tried SQL Server OLE DB driver connection string:
"Provider=sqloledb;Data Source=(local);Initial Catalog=mysite_live;User Id=mysitec_Live;Password=mypass;"
or ODBC driver:
"Driver={SQL Server};Server=SERVERNAME;Trusted_Connection=no;Database=mysite_live;Uid=mysitec_Live;Pwd=mypass;"
At least this is what I would do if nothing helps. Maybe you will be able to get more useful error information.
answered Mar 8, 2013 at 0:23
SlavaSlava
1,0555 silver badges11 bronze badges
Have you tried to use the server IP address instead of the «(local)»?
Something like «Server=192.168.1.1;» (clearly you need to use the real IP address of your server)
In case you try to use the server IP address, check in the «SQL-Server configurator» that SQL Server is listening on the IP address you use in your connection. (SQL Server Configurator screenshot)
Other useful thing to check / try:
- And check also if the DB is in the default SQL Server instance, or if it is in a named instance.
- Do you have checked if the firewall have the TCP/IP rule for opening the port of you SQL Server?
- Have you tried to connect to SQL Server using other software that use the TCP/IP connection?
answered Mar 9, 2013 at 17:56
MaxMax
7,3882 gold badges26 silver badges32 bronze badges
The SQL Server Browser service is disabled by default on installation. I’d recommend that you enable and start it. For more information, see this link and the section titled «Using SQL Server Browser» for an explanation of why this might be your problem.
If you don’t wish to enable the service, you can enable TCP/IP protocol (it’s disabled by default), specify a static port number, and use 127.0.01,<port number> to identify the server.
answered Mar 10, 2013 at 16:41
Paul KeisterPaul Keister
12.8k5 gold badges45 silver badges75 bronze badges
In line 31:
cmd.ActiveConnection = Application("C2M_ConnectionString")
How are you instantiating cmd
?
Rather than the ConnectionString being wrong, maybe cmd
is acting differently in the new environment.
Edited to add:
I see that you’ve gone from IIS 7 to IIS 8. To run Classic ASP sites on IIS 7 required manual changes to server defaults, such as «allow parent paths.» Is it possible that some of the needed tweaks didn’t get migrated over?
If you’re not running with Option Strict On, you should try that — it often reveals the source of subtle problems like this. (Of course, first you’ll be forced to declare all your variables, which is very tedious with finished code.)
answered Mar 5, 2013 at 23:53
egruninegrunin
24.6k8 gold badges49 silver badges93 bronze badges
1
Hi,
I am trying to connect to a a SQL Server database using «Microsoft OLE DB Provider for SQL Server» and SQL Server Authentication since I understand from the following thread that Microsoft OLE DB Provider for SQL Server connection manager is more reliable
than Microsoft Native Client for SQL Server connection manager; —
http://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/fab0e3bf-4adf-4f17-b9f6-7b7f9db6523c/
When I try and connect using SQL Server Authentication I get the following; —
What is the best way to authenticate for a process accessing a SQL Server database which may execute at 3am every morning using Microsoft OLE DB Provider for SQL Server connection manager.
Any help would be greatly appreciated.
Kind Regards,
Kieran.
If you have found any of my posts helpful then please vote them as helpful. Kieran Patrick Wood MCTS BI, PGD SoftDev (Open), MBCS, MCC http://uk.linkedin.com/in/kieranpatrickwood
Modified on: Tue, 7 Apr, 2020 at 4:05 PM
Error Message:
Microsoft OLE DB Provider for SQL Server error ‘80004005’
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.
/test.asp, line 6
Cause:
1. You have connected to a wrong MSSQL server
2. Your database username and password might be incorrect.
Solutions:
1. Make sure that the database connection is well defined with the correct MSSQL host,
port (if required, else optional), database username and password.
Additional Information:
1. If you are Windows 2003 hosting client, you may double check on your database information by :
a. Login into HELM control panel
b. Go to «Domains» >> select the domain name >> «Database Manager»
c. Click on the database name from the list
d. Refer «Connection Information» for MSSQL Server Host, database user is listed under the»Database Users» section.
e. You may manage the database user by click on the database user name or click on «Add New» to setup a new
database user
2. If you are Windows 2000 hosting client, please contact our System Engineer for further information as domain
hosted on Windows 2000 server has been migrated to Windows 2003 server.
Error Description:
microsoft ole db provider for sql server error 80004005
Open Database Connectivity, or ODBC, is a simple approach to construct dynamic website applications.
Web apps, on the other hand, can fail owing to ODBC database connection issues. They too report an microsoft ole db provider for sql server error 80004005
It can be difficult to figure out what’s causing the ODBC problem.
In this article, we’ll look at the top five causes of ODBC error 80004005.
The back-end of the great majority of websites on the internet is a database. The user information and linked data are stored in databases on these websites. We frequently utilize the ODBC approach to display these details on the website.
This ODBC approach, fortunately, is not affected by the website’s coding language. That is, it makes no difference whether your website is written in PHP or ASP.
The ODBC database drivers are responsible for storing the underlying database information and allowing users to connect to database systems. If this database connection fails for whatever reason, microsoft ole db provider for sql server error 80004005 ODBC occurs.
Such ODBC problems are common on websites that use Microsoft Access databases. These errors are generated by ASP websites when they are unable to access the database file. These 80004005 problems can also be found in the OLE DB Provider for ODBC or the Microsoft Jet Database Engine.
What is the reason of the ODBC error 80004005?
It’s now time to investigate the sources of error 80004005. Our Dedicated Engineers frequently face this message in numerous scenarios as a result of their experience managing websites.
1. Permissions are incorrect
Basically, Windows websites should be able to access database files with the extensions.mdb,.ldb, and so on. If any of the read or write permissions are lacking, we will not be able to continue.
2. A process is already under progress.
Multiple processes at once are difficult to manage in Microsoft Access databases. An ODBC connection error can occur if a process still has a file handle open to the database. This usually occurs when users do not properly close the connection. A incomplete upload of a database file via FTP client, for example, can leave an open connection.
3. SQL server constraints
Last but not least, ODBC error 80004005 can also be caused by SQL server security restrictions. When Integrated security is enabled in SQL Enterprise Manager, the windows account should be mapped to the database account. Otherwise, website issues will occur.
4.DSN settings that are incorrect
Data Space Name, or DSN, settings are another typical cause of ODBC issues. DSN, in general, contains information about the website-specific database to which the ODBC driver connects. Any incorrect information will create ODBC connection issues.
5. Customers may neglect to build a DSN or enter the database file’s location incorrectly. Again, DSN creation on servers with control panels may fail to create necessary files on the server. ODBC errors are also generated as a result of this.
6. Database corruption – Obviously, a corrupt database will always result in an error. And, in such cases, search query will not yield correct results and show up ODBC error 80004005.
How Do We Fix microsoft ole db provider for sql server error 80004005?
Normally we couldn’t connect to the database on the website app. The error message displayed on the website was:
Microsoft OLE DB Provider for ODBC Drivers error '80004005' [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
- As a first step, we need to double check the database file permissions and ownership. If the files were properly permissioned under the IUSR account then go to next step.
- On the server we need to make sure an ODBC driver was also present.
- The DSN connection string was then examined. We need to check and correct that the database connection string in the .asa file was correctly setup. If wrongly set up then we need to change the settings and the website would be fault was resolved.
- Similarly, when ODBC problems occur as a result of open connections, we need recycle the website’s application pool, closing any open connections.
This article, suggests a way of resolving the below error message, when you are trying to access SQL Server using “Microsoft OLE DB Provider for SQL Server” and TLS 1.0: [DBNETLIB] [ConnectionOpen (SECDoClientHandshake()).] SSL Security Error
Prior to start writing this article, I was thinking of using a title like “How to still use TLS 1.0”, or something similar, but besides the fact that would have given a wrong message, it would not help so much because many people, usually search for such articles using the error message (SSL Security error)…
So, I anticipate that this article, with this title, would help as many people as possible 🙂
Drop me a line if you find the article useful and why not, subscribe to my newsletter to stay up to date with future articles!
A Few Words About TLS 1.0
TLS 1.0 is considered a deprecated protocol and it is not recommended anymore to be used to secure connections. That’s why many organizations (if not all) transitioned or are in the process of transitioning to newer versions of TLS such as TLS1.1 or above.
However, you may still encounter outdated applications that still need to use this protocol, even for a while for just performing a single operation. One such example, is to try and connect to a SQL Server instance via Microsoft OLE DB Driver for SQL Server using TLS 1.0.
If you are in such situation, I have good news, from a technical aspect, it is still possible to do this.
Read on to learn more.
SQL Server Support for TLS 1.0 and Above
SQL Server still supports all TLS protocols, currently from 1.0 to 1.2. However, depending on the version of SQL Server you have, especially in cases of older SQL Server versions, you might need a patch.
Read this article on SQLNetHub to learn more about SQL Server support for TLS versions.
Now let’s jump to the juicy part of this article and see how finally we can resolve the above error and manage to connect to SQL Server using Microsoft OLE DB Driver for SQL Server and TLS 1.0.
Note that if you are just trying to connect with TLS 1.0 for a while in order to perform a specific task, then make sure to revert the below changes in order to restore the security level of your systems back to their previous level.
Latest Microsoft OLE DB Driver for SQL Server
The first step towards resolving the SSL Security error, is to make sure that the version of the target SQL Server instance you want to connect to, is supported by the driver.
For example, Microsoft OLE DB Driver 18.1 for SQL Server supports connecting to SQL Server 2012 or later.
For older versions of SQL Server, you will need to find an earlier version of Microsoft OLE DB Provider for SQL Server as well.
You can find the latest version of the OLE DB driver here.
Useful details:
The Microsoft OLE DB Provider for SQL Server, allows ADO to access Microsoft SQL Server. However, This is an older driver and it is not recommended to be used driver for new development, since it is deprecated.
The new OLE DB provider is called the Microsoft OLE DB Driver for SQL Server (MSOLEDBSQL) which will be updated with the most recent server features going forward (learn more)
Registry Changes
The next step is, to edit the Windows Registry (* always be careful when messing up with Windows Registry – only certified engineers should do that).
To enable TLS 1.0 in Windows
In Windows Registry, add the below dword keys:
[HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlSecurityProvidersSCHANNELProtocolsTLS 1.0Server]
- “Enabled”=dword:00000001
- “DisabledByDefault”=dword:00000000
[HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlSecurityProvidersSCHANNELProtocolsTLS 1.0Client]
- “Enabled”=dword:00000001
- “DisabledByDefault”=dword:00000000
To disable TLS 1.0 in Windows
[HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlSecurityProvidersSCHANNELProtocolsTLS 1.1Server]
- “Enabled”=dword:00000000
- “DisabledByDefault”=dword:00000001
[HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlSecurityProvidersSCHANNELProtocolsTLS 1.1Client]
- “Enabled”=dword:00000000
- “DisabledByDefault”=dword:00000001
Learn more about the above registry changes in this MS Docs article.
Local Security Policy
The next step is to check the Local Security Policy on the database server.
So, in Local Security Policy on the Database Server, make sure that the setting “System Cryptography: Use FIPS compliant algorithms for encryption, hashing, and signing” is disabled.
If you want to learn more about this security option, you can check this MS Docs article.
Strengthen your SQL Server Administration Skills – Enroll to our Online Course!
Check our online course on Udemy titled “Essential SQL Server Administration Tips”
(special limited-time discount included in link).Via the course, you will learn essential hands-on SQL Server Administration tips on SQL Server maintenance, security, performance, integration, error handling and more. Many live demonstrations and downloadable resources included!
(Lifetime Access/ Live Demos / Downloadable Resources and more!) Enroll from $12.99
Server Protocols, Ciphers, Hashes and Client Protocols
The last step in this troubleshooting guide, is to use IISCrypto, which is an excellent free tool, that allows you to control which protocols, ciphers, and more are enabled (or not) on a Windows server.
That being set, you will need to run IISCrypto and make sure that the “TLS 1.0” Server and Client Protocols, as well as the”SHA” hash are enabled.
Here’s a screenshot of IISCrypto, running on my PC, having TLS 1.0 and “SHA” enabled for illustration purposes:
Note that, if finally you need to perform any changes using IISCrypto, you will need to restart the server.
Actually, for any changes you might need to perform, it is recommended to restart the server.
A Piece of Advice
As mentioned in this article’s beginning, TLS 1.0 is considered a deprecated protocol and it is not recommended anymore to be used to secure connections.
Instead, you should be using newer versions of TLS.
In case you just need to switch to TLS 1.0 for performing an ad hoc task, you need to make sure that after you completed the task, you revoked any changes you might have applied, and disable again TLS 1.0 and the “SHA” hash.
See More
Check out DBA Security Advisor, a SQL Server security tool to assess your SQL Server instances against a rich set of security checks and get security best practice recommendations.
Featured Online Courses:
- SQL Server 2022: What’s New – New and Enhanced Features
- Data Management for Beginners – Main Principles
- Introduction to Azure Database for MySQL
- Working with Python on Windows and SQL Server Databases
- Boost SQL Server Database Performance with In-Memory OLTP
- Introduction to Azure SQL Database for Beginners
- Essential SQL Server Administration Tips
- SQL Server Fundamentals – SQL Database for Beginners
- Essential SQL Server Development Tips for SQL Developers
- Introduction to Computer Programming for Beginners
- .NET Programming for Beginners – Windows Forms with C#
- SQL Server 2019: What’s New – New and Enhanced Features
- Entity Framework: Getting Started – Complete Beginners Guide
- A Guide on How to Start and Monetize a Successful Blog
- Data Management for Beginners – Main Principles
Read Also
- DBA Security Advisor v2.3 is Now Out!
- The OLE DB provider “SQLNCLI11” for linked server “…” supplied inconsistent metadata for a column… – How to Resolve
- SQL Server 2022: What’s New – New and Enhanced Features (Course Preview)
- How to Connect to SQL Server Databases from a Python Program
- What is Data Security and which are its Main Characteristics?
- Introduction to Azure Database for MySQL (Course Preview)
- Data Management for Beginners – Main Principles (Course Preview)
- Advanced SQL Server Features and Techniques for Experienced DBAs
- SQL Server Database Backup and Recovery Guide
Other SQL Server Security-Related Articles
- How to Enable SSL Certificate-Based Encryption on a SQL Server Failover Cluster
- Why You Need to Secure Your SQL Server Instances
- Policy-Based Management in SQL Server
- Advanced SQL Server Features and Techniques for Experienced DBAs
- Should Windows “Built-InAdministrators” Group be SQL Server SysAdmins?
- Frequent Password Expiration: Time to Revise it?
- The “Public” Database Role in SQL Server
- Encrypting SQL Server Databases
- 10 Facts About SQL Server Transparent Data Encryption
- Encrypting a SQL Server Database Backup
- …check all
Subscribe to our newsletter and stay up to date!
Subscribe to our YouTube channel (SQLNetHub TV)
Easily generate snippets with Snippets Generator!
Secure your databases using DBA Security Advisor!
Generate dynamic T-SQL scripts with Dynamic SQL Generator!
Check our latest software releases!
Check our eBooks!
Rate this article: (8 votes, average: 5.00 out of 5)
Loading…
Reference: SQLNetHub.com (https://www.sqlnethub.com)
© SQLNetHub
Artemakis Artemiou is a Senior SQL Server Architect, Author, a 9 Times Microsoft Data Platform MVP (2009-2018). He has over 20 years of experience in the IT industry in various roles. Artemakis is the founder of SQLNetHub and {essentialDevTips.com}. Artemakis is the creator of the well-known software tools Snippets Generator and DBA Security Advisor. Also, he is the author of many eBooks on SQL Server. Artemakis currently serves as the President of the Cyprus .NET User Group (CDNUG) and the International .NET Association Country Leader for Cyprus (INETA). Moreover, Artemakis teaches on Udemy, you can check his courses here.
Views: 24,589