Groups | Blog | Home
all groups > inetserver asp db > december 2004 >

inetserver asp db : SQL login error


Roland Hall
12/18/2004 1:59:28 PM
I'm getting a SQL login error.

Error Type:
Microsoft OLE DB Provider for SQL Server (0x80040E4D)
Login failed for user 'sa'.
/msft/StraightASP.asp, line 7

I downloaded some files from MSFT. This one had an error, so I corrected
it. The '=' was missing between Initial Catalog and PUBS. However, I can
still not login to the database. I verified the password and it works from
QueryAnalyzer.

The files show the difference between pure ASP and XML. The logins are the
same except the two XML files work. They're all in the same directory with
the same code to login to the pubs database and only the pure ASP file
fails.

Here is the login code from StraightASP.asp: (password removed)

Function GetRecordset()
Dim cnn
Set cnn = CreateObject("ADODB.Connection")
cnn.Open "Provider=SQLOLEDB.1;Initial Catalog=PUBS;Data Source=localhost",
"sa", ""
Set GetRecordset = cnn.Execute("select * from authors")
End Function

Here is the login code from StraightXML1.asp (password removed)
Function GetRecordset()
Dim cnn
Set cnn = CreateObject("ADODB.Connection")
cnn.Open "Provider=SQLOLEDB.1;Initial Catalog=PUBS;Data Source=localhost",
"sa", ""
Set GetRecordset = cnn.Execute("select * from authors")
End Function

I got the code from here:
http://msdn.microsoft.com/library/default.asp?url=/msdnmag/issues/1100/beyondasp/toc.asp

To make sure I wasn't missing a character somewhere, I copied from the XML
file to the StraightASP (GetRecordset) function. Still no go.

What am I missing? It appears it's caching somewhere.

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp

Roland Hall
12/18/2004 2:21:20 PM
[quoted text, click to view]
: I'm getting a SQL login error.
:
: Error Type:
: Microsoft OLE DB Provider for SQL Server (0x80040E4D)
: Login failed for user 'sa'.
: /msft/StraightASP.asp, line 7
:
: I downloaded some files from MSFT. This one had an error, so I corrected
: it. The '=' was missing between Initial Catalog and PUBS. However, I can
: still not login to the database. I verified the password and it works
from
: QueryAnalyzer.
:
: The files show the difference between pure ASP and XML. The logins are
the
: same except the two XML files work. They're all in the same directory
with
: the same code to login to the pubs database and only the pure ASP file
: fails.
:
: Here is the login code from StraightASP.asp: (password removed)
:
: Function GetRecordset()
: Dim cnn
: Set cnn = CreateObject("ADODB.Connection")
: cnn.Open "Provider=SQLOLEDB.1;Initial Catalog=PUBS;Data Source=localhost",
: "sa", ""
: Set GetRecordset = cnn.Execute("select * from authors")
: End Function
:
: Here is the login code from StraightXML1.asp (password removed)
: Function GetRecordset()
: Dim cnn
: Set cnn = CreateObject("ADODB.Connection")
: cnn.Open "Provider=SQLOLEDB.1;Initial Catalog=PUBS;Data Source=localhost",
: "sa", ""
: Set GetRecordset = cnn.Execute("select * from authors")
: End Function
:
: I got the code from here:
:
http://msdn.microsoft.com/library/default.asp?url=/msdnmag/issues/1100/beyondasp/toc.asp
:
: To make sure I wasn't missing a character somewhere, I copied from the XML
: file to the StraightASP (GetRecordset) function. Still no go.
:
: What am I missing? It appears it's caching somewhere.

Fricken piece of junk. It must be caching somewhere. I copied the code
into a new file [StraightASP1.asp], same folder, saved it, ran it, and it
worked. *smack*

Is this a server caching problem? I had already restarted SQL.

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp

Roland Hall
12/18/2004 2:34:06 PM
[quoted text, click to view]
: into a new file [StraightASP1.asp], same folder, saved it, ran it, and it
: worked. *smack*
:
: Is this a server caching problem? I had already restarted SQL.

I renamed StraightASP1.asp to StraightASP.asp and it now fails. I have
restarted the web server and the SQL server. It fails from the browser no
the server and a remote workstation on my intranet.

Any clues?

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp

Roland Hall
12/18/2004 3:31:01 PM
[quoted text, click to view]
: > It must be caching somewhere. I copied the code
: >> into a new file [StraightASP1.asp], same folder, saved it, ran it,
: >> and it worked. *smack*
: >>
: >> Is this a server caching problem? I had already restarted SQL.
: >
: > I renamed StraightASP1.asp to StraightASP.asp and it now fails. I
: > have restarted the web server and the SQL server. It fails from the
: > browser no the server and a remote workstation on my intranet.
: >
: > Any clues?
:
: Have you replaced "localhost" with the actual name of your sql server? Or
: used the IP address instead?

Yes. I tried that too. I rename the file back and it works. It's
something that's caching on the server. I've just rebooted so I'll check
and see if it's still an issue.

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp

Roland Hall
12/18/2004 3:38:22 PM
[quoted text, click to view]
:: > It must be caching somewhere. I copied the code
:: >> into a new file [StraightASP1.asp], same folder, saved it, ran it,
:: >> and it worked. *smack*
:: >>
:: >> Is this a server caching problem? I had already restarted SQL.
:: >
:: > I renamed StraightASP1.asp to StraightASP.asp and it now fails. I
:: > have restarted the web server and the SQL server. It fails from the
:: > browser no the server and a remote workstation on my intranet.
:: >
:: > Any clues?
::
:: Have you replaced "localhost" with the actual name of your sql server? Or
:: used the IP address instead?
:
: Yes. I tried that too. I rename the file back and it works. It's
: something that's caching on the server. I've just rebooted so I'll check
: and see if it's still an issue.

Rebooting cleared the problem but nothing has reported what was happening.
I'm still searching for clues as to what went haywire. One of these days
I'm going to be able to work on a single project without having to fix,
move, add, delete or modify something else. I'm probably shooting high.

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp

Roland Hall
12/18/2004 3:51:15 PM
[quoted text, click to view]
::: > It must be caching somewhere. I copied the code
::: >> into a new file [StraightASP1.asp], same folder, saved it, ran it,
::: >> and it worked. *smack*
::: >>
::: >> Is this a server caching problem? I had already restarted SQL.
::: >
::: > I renamed StraightASP1.asp to StraightASP.asp and it now fails. I
::: > have restarted the web server and the SQL server. It fails from the
::: > browser no the server and a remote workstation on my intranet.
::: >
::: > Any clues?
:::
::: Have you replaced "localhost" with the actual name of your sql server?
Or
::: used the IP address instead?
::
:: Yes. I tried that too. I rename the file back and it works. It's
:: something that's caching on the server. I've just rebooted so I'll check
:: and see if it's still an issue.
:
: Rebooting cleared the problem but nothing has reported what was happening.
: I'm still searching for clues as to what went haywire. One of these days
: I'm going to be able to work on a single project without having to fix,
: move, add, delete or modify something else. I'm probably shooting high.

Ok, I have a question.

I was using the default web server for that test and I have anonymous
disabled, basic and authenticated are turned on. SQL server is set for SQL
and Windows authentication. It did as me just on that file to authenticate
and I put in domain\administrator credentials. I don't know why it asked
and it doesn't make sense why it didn't ask on the server, IIRC correctly.
It just seems like there's something there that was confused.

The workstation I was using is in a different domain which is why I entered
credentials on the domain where SQL is located. There is no trust between
then. Now that I've rebooted, it all works fine.

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp

Bob Barrows [MVP]
12/18/2004 4:15:16 PM
[quoted text, click to view]

Have you replaced "localhost" with the actual name of your sql server? Or
used the IP address instead?

Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

Bob Barrows [MVP]
12/18/2004 7:31:32 PM
[quoted text, click to view]

Sorry, I have no answer. i've never run inot this.

Bob Barrows

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

Roland Hall
12/19/2004 4:51:14 AM
[quoted text, click to view]
: > Ok, I have a question.
: >
: > I was using the default web server for that test and I have anonymous
: > disabled, basic and authenticated are turned on. SQL server is set
: > for SQL and Windows authentication. It did as me just on that file
: > to authenticate and I put in domain\administrator credentials. I
: > don't know why it asked and it doesn't make sense why it didn't ask
: > on the server, IIRC correctly. It just seems like there's something
: > there that was confused.
: >
: > The workstation I was using is in a different domain which is why I
: > entered credentials on the domain where SQL is located. There is no
: > trust between then. Now that I've rebooted, it all works fine.
:
: Sorry, I have no answer. i've never run inot this.

Neither have I, until now. Thanks for responding Bob. You're always
helpful.

Roland

AddThis Social Bookmark Button