connection failure

M

middletree

Sorry for the crosspost (I posted this on the asp.db group last night). But
since I had no answer there, I'm hoping for better luck here. I'm pretty
much tried everything I know. Here's the problem:

I have an Intranet-based app at work, and I have it in two places there: a
dev machine and a production box. In both cases, the ASP files and SQL
Server 2000 database are on the same box. I have it running smoothly in both
places at work.

However, I've been trying to set it up at home, and cannot make the SQL
Server connection work for some reason. I've been working on this off and on
for weeks, and I just don't get what I am missing.

First, my code:
<!-- #INCLUDE FILE="includes/dbinc.asp" -->
which points to a page contaning only the followig lines:


=======================
<%
Dim strDBConnection
strDBConnection = _
"Provider=SQLOLEDB;" & _
"Persist Security Info=False;" & _
"Data Source=w2003\ticketlog;" & _
"User ID=asp;" & _
"Password=asp;" & _
"Database=argonet;"
Dim objConnection
Set objConnection = Server.CreateObject("ADODB.Connection")
objConnection.Open strDBConnection
%>
==============================


It's at this point that I should add that this code is just like the
working code from my stuff at work. Only the names have been changed. I
should also add that here at home, the machine I am working on has been
named "W2003", so when I set up SQL Server, it named the instance
W2003\TICKETLOG.(Windows NT). Yes, it has that part with the parentheses.
I don't think the slash is the problem.

Anyway, here is the message I see in the browser when I try to get to any
page which calls this connection code.


====================================
Microsoft OLE DB Provider for SQL Server error '80040e4d'
Login failed for user 'asp'.
/ticketlog/includes/argodbinc.asp, line 15
====================================

I want to add that I did go to the server in EP, went to Security, then
doule-clicked the user called asp, and went to the database tab to make sure
that db_owner and everything else is checked. I then did the same for
INETUSER.

Ok, so pretend I have never done any of this before. What steps do I need to
set up this thing? In my case, I did add a user named asp and gave full
permissions, but assume I haven't done that. Perhaps with detailed
hand-holding instructions, I'll see what I am missing.
 
M

middletree

http://aspfaq.com/show.asp?id=2138

This one basically told me to have mixed authentication, which I already
had.


http://aspfaq.com/show.asp?id=2126

This one had some things to check, but mine code and settings line up with
this article's examples perfectly.


Is this one of yours aswell btw?

http://www.issociate.de/board/post/179115/connection_string--setup_problems.
html

Yes, it is. One person answered, and it was more of a comment than anything
that I could use. I dropped this project for a few weeks, but I am now
getting back to it.
 
R

Ray Costanzo [MVP]

Try opening up Query Analyzer and connecting to that SQL Server with asp/asp
credentials. Does that work?

Ray at home
 
M

middletree

I'm not sure what you mean. I open up QA just fine. I don't see any way to
use QA to connect with anything, though.
 
O

Ollie

Hi,

I sometimes have the same problem when connecting to different SQL servers.
Try adding "Network Library=DBMSSOCN" to the end of your connection string.
Like this...

I'm not promising anything though ;-)

strDBConnection = _
"Provider=SQLOLEDB;" & _
"Persist Security Info=False;" & _
"Data Source=w2003\ticketlog;" & _
"User ID=asp;" & _
"Password=asp;" & _
"Database=argonet;" & _
"Network Library=DBMSSOCN"

Ollie


Sorry for the crosspost (I posted this on the asp.db group last night). But
since I had no answer there, I'm hoping for better luck here. I'm pretty
much tried everything I know. Here's the problem:

I have an Intranet-based app at work, and I have it in two places there: a
dev machine and a production box. In both cases, the ASP files and SQL
Server 2000 database are on the same box. I have it running smoothly in both
places at work.

However, I've been trying to set it up at home, and cannot make the SQL
Server connection work for some reason. I've been working on this off and on
for weeks, and I just don't get what I am missing.

First, my code:
<!-- #INCLUDE FILE="includes/dbinc.asp" -->
which points to a page contaning only the followig lines:


=======================
<%
Dim strDBConnection
strDBConnection = _
"Provider=SQLOLEDB;" & _
"Persist Security Info=False;" & _
"Data Source=w2003\ticketlog;" & _
"User ID=asp;" & _
"Password=asp;" & _
"Database=argonet;"
Dim objConnection
Set objConnection = Server.CreateObject("ADODB.Connection")
objConnection.Open strDBConnection
%>
==============================


It's at this point that I should add that this code is just like the
working code from my stuff at work. Only the names have been changed. I
should also add that here at home, the machine I am working on has been
named "W2003", so when I set up SQL Server, it named the instance
W2003\TICKETLOG.(Windows NT). Yes, it has that part with the parentheses.
I don't think the slash is the problem.

Anyway, here is the message I see in the browser when I try to get to any
page which calls this connection code.


====================================
Microsoft OLE DB Provider for SQL Server error '80040e4d'
Login failed for user 'asp'.
/ticketlog/includes/argodbinc.asp, line 15
====================================

I want to add that I did go to the server in EP, went to Security, then
doule-clicked the user called asp, and went to the database tab to make sure
that db_owner and everything else is checked. I then did the same for
INETUSER.

Ok, so pretend I have never done any of this before. What steps do I need to
set up this thing? In my case, I did add a user named asp and gave full
permissions, but assume I haven't done that. Perhaps with detailed
hand-holding instructions, I'll see what I am missing.
 
O

Ollie

A bit more info on the "Network Library" param

This was found on http://www.connectionstrings.com/

Example:
"Provider=sqloledb;Data Source=190.190.200.100,1433;Network
Library=DBMSSOCN;Initial Catalog=pubs;User ID=sa;Password=asdasd;"

Name Network library
dbnmpntw Win32 Named Pipes
dbmssocn Win32 Winsock TCP/IP
dbmsspxn Win32 SPX/IPX
dbmsvinn Win32 Banyan Vines
dbmsrpcn Win32 Multi-Protocol (Windows RPC)


Important note!
When connecting through the SQLOLEDB provider use the syntax Network
Library=dbmssocn
and when connecting through MSDASQL provider use the syntax Network=dbmssocn

Hi,

I sometimes have the same problem when connecting to different SQL servers.
Try adding "Network Library=DBMSSOCN" to the end of your connection string.
Like this...

I'm not promising anything though ;-)

strDBConnection = _
"Provider=SQLOLEDB;" & _
"Persist Security Info=False;" & _
"Data Source=w2003\ticketlog;" & _
"User ID=asp;" & _
"Password=asp;" & _
"Database=argonet;" & _
"Network Library=DBMSSOCN"

Ollie


Sorry for the crosspost (I posted this on the asp.db group last night). But
since I had no answer there, I'm hoping for better luck here. I'm pretty
much tried everything I know. Here's the problem:

I have an Intranet-based app at work, and I have it in two places there: a
dev machine and a production box. In both cases, the ASP files and SQL
Server 2000 database are on the same box. I have it running smoothly in both
places at work.

However, I've been trying to set it up at home, and cannot make the SQL
Server connection work for some reason. I've been working on this off and on
for weeks, and I just don't get what I am missing.

First, my code:
<!-- #INCLUDE FILE="includes/dbinc.asp" -->
which points to a page contaning only the followig lines:


=======================
<%
Dim strDBConnection
strDBConnection = _
"Provider=SQLOLEDB;" & _
"Persist Security Info=False;" & _
"Data Source=w2003\ticketlog;" & _
"User ID=asp;" & _
"Password=asp;" & _
"Database=argonet;"
Dim objConnection
Set objConnection = Server.CreateObject("ADODB.Connection")
objConnection.Open strDBConnection
%>
==============================


It's at this point that I should add that this code is just like the
working code from my stuff at work. Only the names have been changed. I
should also add that here at home, the machine I am working on has been
named "W2003", so when I set up SQL Server, it named the instance
W2003\TICKETLOG.(Windows NT). Yes, it has that part with the parentheses.
I don't think the slash is the problem.

Anyway, here is the message I see in the browser when I try to get to any
page which calls this connection code.


====================================
Microsoft OLE DB Provider for SQL Server error '80040e4d'
Login failed for user 'asp'.
/ticketlog/includes/argodbinc.asp, line 15
====================================

I want to add that I did go to the server in EP, went to Security, then
doule-clicked the user called asp, and went to the database tab to make sure
that db_owner and everything else is checked. I then did the same for
INETUSER.

Ok, so pretend I have never done any of this before. What steps do I need to
set up this thing? In my case, I did add a user named asp and gave full
permissions, but assume I haven't done that. Perhaps with detailed
hand-holding instructions, I'll see what I am missing.
 
M

middletree

It gave me a different error:

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

Ollie

Try "Network Library=dbnmpntw" as you are not using the IP address.

Have you tried "localhost" instead of "w2003" in the Data Source"???


It gave me a different error:

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

middletree

I'm at work now, so I'll have to try that tonight.

No, I haven't tried localhost yet.


Ollie said:
Try "Network Library=dbnmpntw" as you are not using the IP address.

Have you tried "localhost" instead of "w2003" in the Data Source"???


It gave me a different error:

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





Ollie said:
Hi,

I sometimes have the same problem when connecting to different SQL servers.
Try adding "Network Library=DBMSSOCN" to the end of your connection string.
Like this...

I'm not promising anything though ;-)

strDBConnection = _
"Provider=SQLOLEDB;" & _
"Persist Security Info=False;" & _
"Data Source=w2003\ticketlog;" & _
"User ID=asp;" & _
"Password=asp;" & _
"Database=argonet;" & _
"Network Library=DBMSSOCN"

Ollie


Sorry for the crosspost (I posted this on the asp.db group last night). But
since I had no answer there, I'm hoping for better luck here. I'm pretty
much tried everything I know. Here's the problem:

I have an Intranet-based app at work, and I have it in two places
there:
a
dev machine and a production box. In both cases, the ASP files and SQL
Server 2000 database are on the same box. I have it running smoothly in both
places at work.

However, I've been trying to set it up at home, and cannot make the SQL
Server connection work for some reason. I've been working on this off
and
on
for weeks, and I just don't get what I am missing.

First, my code:
<!-- #INCLUDE FILE="includes/dbinc.asp" -->
which points to a page contaning only the followig lines:


=======================
<%
Dim strDBConnection
strDBConnection = _
"Provider=SQLOLEDB;" & _
"Persist Security Info=False;" & _
"Data Source=w2003\ticketlog;" & _
"User ID=asp;" & _
"Password=asp;" & _
"Database=argonet;"
Dim objConnection
Set objConnection = Server.CreateObject("ADODB.Connection")
objConnection.Open strDBConnection
%>
==============================


It's at this point that I should add that this code is just like the
working code from my stuff at work. Only the names have been changed. I
should also add that here at home, the machine I am working on has been
named "W2003", so when I set up SQL Server, it named the instance
W2003\TICKETLOG.(Windows NT). Yes, it has that part with the parentheses.
I don't think the slash is the problem.

Anyway, here is the message I see in the browser when I try to get to any
page which calls this connection code.


====================================
Microsoft OLE DB Provider for SQL Server error '80040e4d'
Login failed for user 'asp'.
/ticketlog/includes/argodbinc.asp, line 15
====================================

I want to add that I did go to the server in EP, went to Security, then
doule-clicked the user called asp, and went to the database tab to make sure
that db_owner and everything else is checked. I then did the same for
INETUSER.

Ok, so pretend I have never done any of this before. What steps do I
need
to
set up this thing? In my case, I did add a user named asp and gave full
permissions, but assume I haven't done that. Perhaps with detailed
hand-holding instructions, I'll see what I am missing.
 
R

Ray Costanzo [MVP]

But when you connect the DB using QA, are you logging into the SQL Server as
the "asp" user or are you using your own logon credentials?

Ray at work
 
R

Ray Costanzo [MVP]

Right, probably because it's automatically logging you in with your Windows
credentials, like if you're opening it up from Enterprise Manager. Instead
of doing that, manually launch the program and specify asp/asp login
credentials. Or, if you have it already open, do a File---Connect, and
that'll give you the option to specificy other login credentials.

Ray at work
 
M

middletree

OK, I'll try that at home tonight. But let's say that asp/asp combo does
work using QA, then what?

Or if it doesn't, then what?
 
R

Ray Costanzo [MVP]

middletree said:
OK, I'll try that at home tonight. But let's say that asp/asp combo does
work using QA, then what?

Then you ruled out that it's a login credentials issue.

Or if it doesn't, then what?

Then it's a login credentials issue.

:]

Ray at work
 
M

middletree

Thanks. What I meant was, I don't know what to do at that point.


Ray Costanzo said:
middletree said:
OK, I'll try that at home tonight. But let's say that asp/asp combo does
work using QA, then what?

Then you ruled out that it's a login credentials issue.

Or if it doesn't, then what?

Then it's a login credentials issue.

:]

Ray at work
 
R

Ray Costanzo [MVP]

Well that very much depends on the result!

Ray at work

middletree said:
Thanks. What I meant was, I don't know what to do at that point.


Ray Costanzo said:
middletree said:
OK, I'll try that at home tonight. But let's say that asp/asp combo does
work using QA, then what?

Then you ruled out that it's a login credentials issue.

Or if it doesn't, then what?

Then it's a login credentials issue.

:]

Ray at work
 
B

Bob Barrows [MVP]

If it's not a login credentials issue, then we need to look elsewhere for
the problem.

If you cannot login using asp/asp then there are two possibilities:

1. SQL Server is configured to do Integrated Authentication only, which
means that it is configured to only allow Windows accounts to log in.
Authentication will need to be switched to "Mixed" if you want to use a
non-Windows login, i.e. a SQL Login
2. SQL is configured correctly to allow "Mixed" authentication, but the
"asp" login account was never created on the SQL Server. In this case, you
will need to add the "asp" login account and grant it rights to your
database.

Bob Barrows
Thanks. What I meant was, I don't know what to do at that point.


Ray Costanzo said:
middletree said:
OK, I'll try that at home tonight. But let's say that asp/asp combo
does work using QA, then what?

Then you ruled out that it's a login credentials issue.

Or if it doesn't, then what?

Then it's a login credentials issue.

:]

Ray at work
 
M

middletree

Yes, well, you and Ray are correct. When I tried to connect using the
asp/asp combo, it wouldn't let me in. When I went into the registration
properties, it said Windows authentication, when i could have sworn I
checked it abouit 10 times and it said mixed.

Anyway, in that window, I tried to change it to SQL authentication, and
typed asp/asp in there, and it wouldn't let me. It said that asp is not a
valid user.

This is really, really frustrating. 5 years of doing ASP with SQL Server,
and I have never had this kind of problem before. I am not sure what to do.
I guess I'll go in there and dig some more, make some changes, see what
happens.

Anyway, thanks for your help.


Bob Barrows said:
If it's not a login credentials issue, then we need to look elsewhere for
the problem.

If you cannot login using asp/asp then there are two possibilities:

1. SQL Server is configured to do Integrated Authentication only, which
means that it is configured to only allow Windows accounts to log in.
Authentication will need to be switched to "Mixed" if you want to use a
non-Windows login, i.e. a SQL Login
2. SQL is configured correctly to allow "Mixed" authentication, but the
"asp" login account was never created on the SQL Server. In this case, you
will need to add the "asp" login account and grant it rights to your
database.

Bob Barrows
Thanks. What I meant was, I don't know what to do at that point.


Ray Costanzo said:
OK, I'll try that at home tonight. But let's say that asp/asp combo
does work using QA, then what?

Then you ruled out that it's a login credentials issue.


Or if it doesn't, then what?

Then it's a login credentials issue.

:]

Ray at work

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top