Error encountered accessing Sql Server from ASP page

Appreciate any input to resolve this problem.

Thank you in advance.

Jack


1) Using a local web server on desktop WinXP-PRO
2) Connecting to a Win 2003 server - SQL server 2000 SP4
3) SQL server is configured for Mixed mode authentication (Windows and
Sql Server)
4) ALL Connection strings worked in VB
5) Network is a WORKGROUP environment


<html>

<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<title>New Page 1</title>
<%
Dim cnn, rs
Dim SqlString
Dim CnString
Set Cnn = Server.CreateObject("ADODB.Connection")
Set rs = Server.CreateObject("ADODB.Recordset")

' BOTH Connection String worked in VB
'CnString = "PROVIDER=SQLOLEDB;Data
Source=server;UID=sa;PWD=;DATABASE=ABCSTORE;"
'CnString = "PROVIDER=SQLOLEDB;Data Source=server;Integrated
Security=SSPI;DATABASE=ABCStore;"
CnString = "driver={SQL
Server};server=192.168.1.6;database=ABCSTORE;UID=sa;PWD=;"
cnn.Open CnString

SqlString = "Select top 10 * from wbw_line"

rs.Open SqlString, cnn

While Not rs.EOF
response.write rs(0)
rs.MoveNext
Wend
cnn.Close
Set cnn = Nothing
Set rs = Nothing
%>
</head>

<body>

</body>

</html>




Results from DIFFERENT connection strings:

CnString = "PROVIDER=SQLOLEDB;Data
Source=server;UID=sa;PWD=;DATABASE=ABCSTORE;"
Error Type:
Microsoft OLE DB Provider for SQL Server (0x80004005)
Login failed for user 'sa'. Reason: Not associated with a trusted SQL
Server connection.
/testpage.asp, line 16


CnString = "PROVIDER=SQLOLEDB;Data Source=server;Integrated
Security=SSPI;DATABASE=ABCStore;"
Error Type:
Microsoft OLE DB Provider for SQL Server (0x80004005)
Login failed for user '(null)'. Reason: Not associated with a trusted
SQL Server connection.
/testpage.asp, line 16

Also tried using:
CnString = "driver={SQL
Server};server=192.168.1.6;database=ABCSTORE;UID=sa;PWD=;"
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E4D)
[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user
'sa'. Reason: Not associated with a trusted SQL Server connection.
/testpage.asp, line 17
jackso95 [ Fr, 17 November 2006 18:54 ] [ ID #1539568 ]

Re: Error encountered accessing Sql Server from ASP page

On 17 Nov 2006 09:54:58 -0800, jackso95 [at] hotmail.com wrote:

>Appreciate any input to resolve this problem.

>Microsoft OLE DB Provider for SQL Server (0x80004005)
>Login failed for user 'sa'. Reason: Not associated with a trusted SQL
>Server connection.

FAQ:
http://tutorials.aspfaq.com/8000xxxxx-errors/80004005-errors .html

Jeff
jeff.nospam [ Sa, 18 November 2006 14:27 ] [ ID #1540423 ]
Webserver » microsoft.public.inetserver.asp.db » Error encountered accessing Sql Server from ASP page

Vorheriges Thema: Recommend an excellent ASP program gives everyone:Webmaster club news system v5.09
Nächstes Thema: windows integrated authentication