473,388 Members | 1,177 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Connecting Sql Server 2005 from ASP?

Hi
We are planning to move over to SQL Server 2005 in near future.

At the moment Website is on a seperate server then the Database.
OS for both the server is Window 2003 and currently our data is on SQL
Server 2000(on which everything works fine).
Part of the testing process we tried to connect our website on SQL 2005
and it does not work at all.

I get this

----------------------------------------------------------------
ADODB.Connection error '800a0e7a'
Provider cannot be found. It may not be properly installed.

When i use following connection string
"Provider=SQLNCLI;Server=127.0.0.1;Database=dbName ;UID=UserName;PWD=UserPassword;"

(Above string has fixed problem for few people- googled it, but not for
me.)
----------------------------------------------------------------

----------------------------------------------------------------
This is the message i get for all the following connectiong string

Microsoft OLE DB Provider for SQL Server error '80004005'

[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or
access denied.

1) - "Provider=SQLOLEDB.1;Password=UserPassword;Per sist Security
Info=True;User ID=UserName;Initial Catalog=ABC;Data
Source=XXX.XX.X.XX,1433"
2) - "Provider=sqloledb;Data Source=XXX.XX.X.XX,1433;Network
Library=DBMSSOCN;Initial Catalog=ABC;User
ID=UserName;Password=UserPassword"
3) - "Provider=SQLOLEDB.1;Persist Security Info=True;User
ID=UserName;Initial Catalog=ABC;Data Source = ServerName\SQLInstance"

----------------------------------------------------------------
I tried connecting to SQL Server 2005 through our system developed in
VB.Net 2003 and it works fine and here is the Connection String :

"Data Source=ServerName\SQLInstance;Initial Catalog=ABC;Persist
Security Info=False;user id=UserName;password=UserPassword"

I would really appreciate any help.

Mits

Jun 16 '06 #1
10 13657
(MV*******@googlemail.com) writes:
We are planning to move over to SQL Server 2005 in near future.

At the moment Website is on a seperate server then the Database.
OS for both the server is Window 2003 and currently our data is on SQL
Server 2000(on which everything works fine).
Part of the testing process we tried to connect our website on SQL 2005
and it does not work at all.

I get this

----------------------------------------------------------------
ADODB.Connection error '800a0e7a'
Provider cannot be found. It may not be properly installed.

When i use following connection string
"Provider=SQLNCLI;Server=127.0.0.1;
Did you install SQL Native Client on the web server? SQL Native Client
is a DLL that contains versions of both the ODBC SQL Server Driver
and the SQL Server OLE DB Provider that has been enhanced with support
for SQL 2005.

SQL Native Client is freely distributable.
This is the message i get for all the following connectiong string

Microsoft OLE DB Provider for SQL Server error '80004005'

[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or
access denied.


Note that by default some editions of SQL 2005 by default only permits
local connections. You can modify this in the Surface Area Configuration
Tool.

You may also have to encure that the SQL Browser service is running.


--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Jun 16 '06 #2
Hi Erland
Thanks for your reply.
I still cant conntect to SQL Server.

I downloaded SQL Native Client and installed on the web server.

I looked in SAC Tool and "Local and Remote Connection" and "Using Both
TCP/IP and Named Pipes" options are selected. I have checked SQL
Browser service is running.

Now when i use this string

"Provider=SQLNCLI;Server=127.0.0.1;Database=DBName ;UID=UserName;PWD=UserPassword;"

i get

Microsoft SQL Native Client error '80040e4d'

Login failed for user 'UserName'.

I have created this user and this user has proper permission to access
the database i need.
Is there any special permissions that need? This is driving me crazy.
Mits



You may also have to encure that the SQL Browser service is running.

Erland Sommarskog wrote:
(MV*******@googlemail.com) writes:
We are planning to move over to SQL Server 2005 in near future.

At the moment Website is on a seperate server then the Database.
OS for both the server is Window 2003 and currently our data is on SQL
Server 2000(on which everything works fine).
Part of the testing process we tried to connect our website on SQL 2005
and it does not work at all.

I get this

----------------------------------------------------------------
ADODB.Connection error '800a0e7a'
Provider cannot be found. It may not be properly installed.

When i use following connection string
"Provider=SQLNCLI;Server=127.0.0.1;


Did you install SQL Native Client on the web server? SQL Native Client
is a DLL that contains versions of both the ODBC SQL Server Driver
and the SQL Server OLE DB Provider that has been enhanced with support
for SQL 2005.

SQL Native Client is freely distributable.
This is the message i get for all the following connectiong string

Microsoft OLE DB Provider for SQL Server error '80004005'

[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or
access denied.


Note that by default some editions of SQL 2005 by default only permits
local connections. You can modify this in the Surface Area Configuration
Tool.

You may also have to encure that the SQL Browser service is running.


--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx


Jun 17 '06 #3
The SQL 2005 password is case sensitive while 2000 wasn't, so code that
works on SQL 2000 for logging in may not work on 2005.

MV*******@googlemail.com wrote:
Hi Erland
Thanks for your reply.
I still cant conntect to SQL Server.

I downloaded SQL Native Client and installed on the web server.

I looked in SAC Tool and "Local and Remote Connection" and "Using Both
TCP/IP and Named Pipes" options are selected. I have checked SQL
Browser service is running.

Now when i use this string

"Provider=SQLNCLI;Server=127.0.0.1;Database=DBName ;UID=UserName;PWD=UserPassword;"

i get

Microsoft SQL Native Client error '80040e4d'

Login failed for user 'UserName'.

I have created this user and this user has proper permission to access
the database i need.
Is there any special permissions that need? This is driving me crazy.
Mits



You may also have to encure that the SQL Browser service is running.

Erland Sommarskog wrote:
(MV*******@googlemail.com) writes:
We are planning to move over to SQL Server 2005 in near future.

At the moment Website is on a seperate server then the Database.
OS for both the server is Window 2003 and currently our data is on SQL
Server 2000(on which everything works fine).
Part of the testing process we tried to connect our website on SQL 2005
and it does not work at all.

I get this

----------------------------------------------------------------
ADODB.Connection error '800a0e7a'
Provider cannot be found. It may not be properly installed.

When i use following connection string
"Provider=SQLNCLI;Server=127.0.0.1;


Did you install SQL Native Client on the web server? SQL Native Client
is a DLL that contains versions of both the ODBC SQL Server Driver
and the SQL Server OLE DB Provider that has been enhanced with support
for SQL 2005.

SQL Native Client is freely distributable.
This is the message i get for all the following connectiong string

Microsoft OLE DB Provider for SQL Server error '80004005'

[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or
access denied.


Note that by default some editions of SQL 2005 by default only permits
local connections. You can modify this in the Surface Area Configuration
Tool.

You may also have to encure that the SQL Browser service is running.


--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx


Jun 17 '06 #4
I know there is no issue with Password.
I just realised one thing i dont know if it matters..
Between our webserver there is a firewall, do we need to punch a hole
that will allow communication between our webserver and DB Server.


Mits

pb648174 wrote:
The SQL 2005 password is case sensitive while 2000 wasn't, so code that
works on SQL 2000 for logging in may not work on 2005.

MV*******@googlemail.com wrote:
Hi Erland
Thanks for your reply.
I still cant conntect to SQL Server.

I downloaded SQL Native Client and installed on the web server.

I looked in SAC Tool and "Local and Remote Connection" and "Using Both
TCP/IP and Named Pipes" options are selected. I have checked SQL
Browser service is running.

Now when i use this string

"Provider=SQLNCLI;Server=127.0.0.1;Database=DBName ;UID=UserName;PWD=UserPassword;"

i get

Microsoft SQL Native Client error '80040e4d'

Login failed for user 'UserName'.

I have created this user and this user has proper permission to access
the database i need.
Is there any special permissions that need? This is driving me crazy.
Mits



You may also have to encure that the SQL Browser service is running.

Erland Sommarskog wrote:
(MV*******@googlemail.com) writes:
> We are planning to move over to SQL Server 2005 in near future.
>
> At the moment Website is on a seperate server then the Database.
> OS for both the server is Window 2003 and currently our data is on SQL
> Server 2000(on which everything works fine).
>
>
> Part of the testing process we tried to connect our website on SQL 2005
> and it does not work at all.
>
> I get this
>
> ----------------------------------------------------------------
> ADODB.Connection error '800a0e7a'
> Provider cannot be found. It may not be properly installed.
>
> When i use following connection string
> "Provider=SQLNCLI;Server=127.0.0.1;

Did you install SQL Native Client on the web server? SQL Native Client
is a DLL that contains versions of both the ODBC SQL Server Driver
and the SQL Server OLE DB Provider that has been enhanced with support
for SQL 2005.

SQL Native Client is freely distributable.

> This is the message i get for all the following connectiong string
>
> Microsoft OLE DB Provider for SQL Server error '80004005'
>
> [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or
> access denied.

Note that by default some editions of SQL 2005 by default only permits
local connections. You can modify this in the Surface Area Configuration
Tool.

You may also have to encure that the SQL Browser service is running.


--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx


Jun 17 '06 #5
MV*******@googlemail.com (MV*******@googlemail.com) writes:
Thanks for your reply.
I still cant conntect to SQL Server.

I downloaded SQL Native Client and installed on the web server.

I looked in SAC Tool and "Local and Remote Connection" and "Using Both
TCP/IP and Named Pipes" options are selected. I have checked SQL
Browser service is running.

Now when i use this string

"Provider=SQLNCLI;Server=127.0.0.1;Database=DBName ;UID=UserName;PWD=UserPass
word;"
i get

Microsoft SQL Native Client error '80040e4d'
Login failed for user 'UserName'.


This is strange, because as I understood your original post, you were
connecting from a web server that was a on different machine from where
SQL Server is running.

However, in your connection string you have specified 127.0.0.1 which is
always the local machine. Still, you do make contact with an SQL Server
instance since you get that message.

Since I don't see your configuration, I'm left to guessworks, but there
are two obvious possibilities:
1) You have the username/password wrong.
2) You have an of SQL Server on the web server as well, but that's
not the one you intend to connect to.

--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Jun 17 '06 #6
hi Erland

I am sorry if i confued you, you are right WebServer and DB Server are
2 different machines. I have replaced 127.0.0.1 with the IP of DB
server and now the error is

TCP Provider: An existing connection was forcibly closed by the remote
host.

Configuration of Servers are as follows

Webserver
OS Windows 2003

Database Server
OS Windows 2003
DB SQL Server 2005 with Service Pack1

Mits

Erland Sommarskog wrote:
MV*******@googlemail.com (MV*******@googlemail.com) writes:
Thanks for your reply.
I still cant conntect to SQL Server.

I downloaded SQL Native Client and installed on the web server.

I looked in SAC Tool and "Local and Remote Connection" and "Using Both
TCP/IP and Named Pipes" options are selected. I have checked SQL
Browser service is running.

Now when i use this string

"Provider=SQLNCLI;Server=127.0.0.1;Database=DBName ;UID=UserName;PWD=UserPass
word;"

i get

Microsoft SQL Native Client error '80040e4d'
Login failed for user 'UserName'.


This is strange, because as I understood your original post, you were
connecting from a web server that was a on different machine from where
SQL Server is running.

However, in your connection string you have specified 127.0.0.1 which is
always the local machine. Still, you do make contact with an SQL Server
instance since you get that message.

Since I don't see your configuration, I'm left to guessworks, but there
are two obvious possibilities:
1) You have the username/password wrong.
2) You have an of SQL Server on the web server as well, but that's
not the one you intend to connect to.

--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx


Jun 19 '06 #7
MV*******@googlemail.com (MV*******@googlemail.com) writes:
I am sorry if i confued you, you are right WebServer and DB Server are
2 different machines. I have replaced 127.0.0.1 with the IP of DB
server and now the error is

TCP Provider: An existing connection was forcibly closed by the remote
host.

Configuration of Servers are as follows

Webserver
OS Windows 2003

Database Server
OS Windows 2003
DB SQL Server 2005 with Service Pack1

Have you configured SQL 2005 to accept remote connections? The Developer
and Express Editions of SQL 2005 accepts by default local connection only.

Use the Surface Area Configuration tool to check and change this.

Also make sure that the SQL Server Browser service is running.

--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Jun 19 '06 #8
In SAC I have enabled Local and Remote Connection and also SQL Browser
service is running and is also Active.

Mits

Erland Sommarskog wrote:
MV*******@googlemail.com (MV*******@googlemail.com) writes:
I am sorry if i confued you, you are right WebServer and DB Server are
2 different machines. I have replaced 127.0.0.1 with the IP of DB
server and now the error is

TCP Provider: An existing connection was forcibly closed by the remote
host.

Configuration of Servers are as follows

Webserver
OS Windows 2003

Database Server
OS Windows 2003
DB SQL Server 2005 with Service Pack1

Have you configured SQL 2005 to accept remote connections? The Developer
and Express Editions of SQL 2005 accepts by default local connection only.

Use the Surface Area Configuration tool to check and change this.

Also make sure that the SQL Server Browser service is running.

--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx


Jun 19 '06 #9
MV*******@googlemail.com (MV*******@googlemail.com) writes:
In SAC I have enabled Local and Remote Connection and also SQL Browser
service is running and is also Active.


And you did restart SQL Server after enabling remote connections?
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Jun 19 '06 #10
Good News guys got it all working.
I really appreciate all the effort and time put in by Erland .

These are the steps i did, and i dont it might help anyone out there.

Our Webserver is outside DMZ on our network. It can only communicate
through secured channels on our linux firewall. I have got a named
Instance of SQL Server 2005(Enterprise Edition)

1) I punched a hole through our firewall that will allow communication
between our Webserver and DB server through specific Port.
2) I Installed SQL Native Client on Webserver.
3) In SSCM(SQL Server Configuration Manager) Tool
On Console Pane, Click Protocols for <Instance Name>
Double Click TCP/IP
Listen To All ---> No

For IP1
Active = Yes
Enabled = Yes
IP Address = IP of the DB Server
TCP = Blank/Nothing
TCP Port = 1433( or any port number but it has to be the same that
you have defined in firewall)

Save Everything and Re-start the SQL Server (Instance Name) Service.

This is the example of connection string that worked

Provider=SQLNCLI.1;Persist Security Info=False;User
ID=UserNamer;Password=UserPassword;Initial Catalog=NameofDatabase;Data
Source=DBServerName

Mits

Erland Sommarskog wrote:
MV*******@googlemail.com (MV*******@googlemail.com) writes:
In SAC I have enabled Local and Remote Connection and also SQL Browser
service is running and is also Active.


And you did restart SQL Server after enabling remote connections?
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx


Jun 20 '06 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Ann Marinas | last post by:
Hi all, I would like to ask for some help regarding separating the asp.net webserver and the sql server. I have created an asp.net application for a certain company. Initially, we installed...
3
by: Ann Marinas | last post by:
Hi there, I am currently developing an ASP.NET program that connects to a SQL Server 2000 database. I also have SQL Server 2005 Express installed on the same local machine. Prior to...
2
by: hfk0 | last post by:
Hello, I'm a newbie here and was wondering anyone could help me with this. I have a simple ASP.NET 2 web application running perfectly fine with IIS and SQLServerExpress installed locally on...
6
by: Todd Brewer | last post by:
Windows Server 2000 ASP.NET 2.0 SQL Server 2000 (on a physically seperate server) I moved an ASP.NET 2.0 application from a development server to production, and am getting the following error:...
2
by: Patrick F | last post by:
Hi, i have SQL Server 2005 and a database set that is called, myCompany the problem is that i cant connect from my page to it, here is from the web.config: ( i have got this connectionstring from...
8
by: =?Utf-8?B?U3JpcmFtIE1hbGxhanlvc3VsYQ==?= | last post by:
Hi, I am not sure whether this is the correct newsgroup where I need to post my question. Let me know where I need to post for a quick response. I get the following error when I try to connect...
2
by: samadams_2006 | last post by:
Hello, I have a problem that I'm hoping someone will be able to help me resolve. 1) I have a C# Web Site in which I connect to the database: "Install Microsoft SQL Server 2005 Express...
3
by: Me LK | last post by:
I did a search but could not find an aswer that worked so here it goes. I just did an upgrade from 2003 to vs 2005 express. I am using a remote sql server 2000. I specifically upgrade to make...
0
by: aboutjav.com | last post by:
Hi, I need some help. I am getting this error after I complete the asp.net register control and click on the continue button. It crashed when it tries to get it calls this Profile property ...
0
by: mina | last post by:
My application which is written in vb.net 2005 uses sql server 2005 express as a database, this application is multi-user. So i am used 3 xp machine to install my application i can say...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.