Posted by Jim Bunton on 09/19/05 14:52
Win 2000, sqlServer 2000 Personal edition
Trying ot connect using .asp Vb Script
1. Sql server set to use Windows Authentication
2. Log onto Windows 2000 as Jim Bunton {no password)
3 Server 'Study' running ok
4. sql query analyser
i. "SELECT User_Name > dbo
ii. [using database NorthWind]
"SELECT * FROM Customers" > gives expected result
5. VB script
** BEGIN CODE connect.asp ***
<%
@ LANGUAGE="VBSCRIPT"
%>
<%
Option explicit
response.expires = 0
%>
<!-- #include file="adovbs.inc" -->
<html>
<head>
<title></title>
</head>
<body>
<%
dim Cn, CnStr
Set Cn = Server.CreateObject("ADODB.Connection")
Cn.ConnectionTimeOut = 1
Cn.provider="sqloledb"
response.write "Conn Provider is " & Cn.provider
CnStr="Data Source=Study;Initial Catalog=Norhwind;User
Id=sa;Password=;"
' Tried all sorts of user id's and paswords
'CnStr="Data Source=Study;Initial Catalog=Norhwind;User Id =
'Jim Bunton';Password=;"
'CnStr="Data Source=Study;Initial Catalog=Norhwind;User Id
=dbo;Password=;"
'CnStr="Data Source=Study;Initial Catalog=Norhwind;User Id =
JimBunton;Password=;"
'CnStr="Data Source='Study';Initial Catalogue='Norhwind';User Id
='Study\Jim Bunton';Password=;"
%>
<p>----------</p>
<%
response.write "Cnstr = " & CnStr
'ERROR ALWAYS OCCURS ON NEXT LINE
Cn.open CnStr
'Error Type:
'(0x80004005)
'Unspecified error
'/myweb/mywebs/connect.asp, line 35
%>
<p>----------</p>
<%
response.write "The End - ran ok"
%>
</body>
</html>
**** END CODE *****
? what to do??
?? am I missing something 'obvious' out ???
--
Jim Bunton
[Back to original message]
|