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

.



Relevant Pages

  • Re: SQL Express 2005 doesnt support multiple users....
    ... > database should specify the same connection. ... With user instances, you are ... > Express) and set both client connection strings to ... > Jasper Smith (SQL Server MVP) ...
    (microsoft.public.sqlserver.connect)
  • Re: Connections String Questions
    ... As far as Q1 - always use SqlClient with a SQL Server or SQL Express ... Help on connection strings to see what best suits your application. ... Which provider should be preferred when defining a connection, ... I have a database on my local PC and the same ...
    (microsoft.public.dotnet.framework.adonet)
  • OLAP connection problems
    ... I have two systems setup with SQL Server 2000 + Analysis Services. ... servers have been patched with both SP3a patches. ... I wrote a trivial command line app that tests connection strings through ... It is very frustrating to get an absolutely generic error message. ...
    (microsoft.public.sqlserver.programming)
  • Re: data access strategy
    ... there must be a Domain in your LAN so that you and your users can connect to your SQL Server instance using Windows Authentication. ... Also, you did not mention if 8082 is a static or dynamic port but that's for sure it's not the default port so you must be using a Named Instance instead of a Default Instance and it means that your Named Instance will be using dynamic ports by default and if it uses a dynamic port, it means that this dynamic port will be changed when your SQL Server service restarts. ... I've tried all manner of connection strings to connect remotely. ...
    (microsoft.public.sqlserver.connect)
  • RE: Allowing user selection of a datasource at run time?
    ... but you can build connection strings to connect to any OLEDB ... the SQL Server instances, which is much easier. ... I need to allow> a user to select a database to connect to at run time via a standard dialog> box. ... This causes the 'Data Link Properties' dialog box to appear> which allows the user to select an OLEDB data provider, and a database, etc. ...
    (microsoft.public.dotnet.framework.adonet)

Loading