Error encountered accessing Sql Server from ASP page
am 17.11.2006 18:54:58 von jackso95Appreciate 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
<%
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
%>
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