Can't Connect



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 LINEon the next line
Cn.open CnStr
%>
<p>----------</p>
<%
response.write "The End - ran ok"
%>

</body>

</html>

**** END CODE *****

? what to do??
?? am I missing something 'obvious' out ???

--


Jim Bunton




.



Relevant Pages

  • Cant connect
    ... Trying ot connect using .asp Vb Script ... Sql server set to use Windows Authentication ... Cn.open CnStr ...
    (microsoft.public.inetserver.asp.db)
  • Cant connect to SqlServer
    ... Trying ot connect using .asp Vb Script ... Sql server set to use Windows Authentication ... Cn.open CnStr ...
    (microsoft.public.scripting.vbscript)
  • Cant connect
    ... Trying ot connect using .asp Vb Script ... Sql server set to use Windows Authentication ... 'Unspecified error ...
    (comp.databases.ms-sqlserver)
  • Re: Cant connect to SqlServer
    ... Since you're using windows integrated security try using; ... | Trying ot connect using .asp Vb Script ... Sql server set to use Windows Authentication ... | dim Cn, CnStr ...
    (microsoft.public.scripting.vbscript)

Loading