PDA

View Full Version : Problem with Authentication?



slezberg
12-09-2002, 01:00 PM
I am trying to setup to autenticate a user and it is always failing. I know it is making the POST because I see it in my IIS log. What am I doing wrong here? The query works correctly in Query Analyzer.

Also, if it fails, when does it see the other text below or does it only display the failed message from the Update Service UI.

Thanks

Scott

<html>
<body>

<%
Dim adoRS 'ADODB.Recordset
Dim objConn 'Connection
Dim sql 'SQL Query

Set objConn = Server.CreateObject("ADODB.Connection")

'sql = "select UserName, Password , StartDate, ExpiryDate from UserDatabase db where db.UserName='" & Request("UserName") & "' AND db.Password = '" & Request("Password") & "' AND GETDATE() between db.StartDate and db.ExpiryDate"
sql = "SELECT dbo.zSysClienteleNetLogin.LoginName, dbo.zSysClienteleNetLogin.Password, Clientele.Org.DEL_CLIENT_ID, Clientele.Person.FirstName, Clientele.Person.LastName, Clientele.Person.EmailAddress, Clientele.Product.ExpireDate, Clientele.Person.Per_ID FROM (Clientele.Person left JOIN Clientele.Product ON Clientele.Person.Org_ID = Clientele.Product.Org_ID) left JOIN dbo.zSysClienteleNetLogin ON Clientele.Person.Per_ID = dbo.zSysClienteleNetLogin.Per_ID inner join Clientele.Org ON Clientele.Person.Org_id=Clientele.Org.Org_ID " & _
"where dbo.zSysClienteleNetLogin.LoginName = '" & Request("Username") & "'" & _
"And dbo.zSysClienteleNetLogin.Password = '" & Request("Password") & "'" & _
"And GETDATE()< Clientele.product.ExpireDate"

' Set up the connection
objConn.Open "Provider=sqloledb; Data Source=XX.XX.XX.XX; Initial Catalog=XXXXXXXXXX; User Id=XXXXX; Password=XXXXXX"

Set objRS=objConn.Execute(sql)

If objRS.EOF Then
Response.Write "FAILED"
' The following text is written to the Update Service user interface
Response.Write "This can happen for any of the following reasons:" & vbCRLF
Response.Write "- Incorrect username" & vbCRLF
Response.Write "- Incorrect password" & vbCRLF
Response.Write "- Your OSP has expired" & vbCRLF
Response.Write "Please contact Deltek Vision Support (DeltekVisionSupport@ma.deltek.com) for more information" & vbCRLF
Else
Response.Write "OK"
End If
%>


</body>

</html>