Hey :
I am trying to make a "simple" DLL that accepts userid and password in a VB DLL and using that info connecting to a database and testing for a valid login. I wrote the DLL and registered it (I think) and then wrote the ASP to use it, yet I get an object required message. here is the DLL code and following is the ASP code. Any help or pointers greatfully accepted!
=================================
DLL VB Code
=================================
Public Function login_test(user_id, password) As Boolean
Dim objConn, strConnection, objRS, strQuery, Answer
Set objConn = Server.CreateObject("ADODB.Connection"
strConnection = "DSN=secure;Database=secure;UID=secure_login;PWD=simonp;"
objConn.Open strConnection
strQuery = "SELECT * FROM login WHERE userid = '" & user_id & "';"
Set objRS = objConn.Execute(strQuery)
If objRS.EOF = True Then
Answer = False
Else
If objRS("password"
<> password Then
Answer = False
Else
Answer = True
End If
End If
login_test = Answer
End Function
=================================
ASP Code
=================================
<% @LANGUAGE = VBScript %>
<% option explicit
Response.Expires = 0
Dim objConn, objRS, strQuery, loginOBJ, result
Dim strConnection, strBuild, form_psw, database_psw, form_user, database_user
If Request.ServerVariables("CONTENT_LENGTH"
<> 0 Then
form_user = request.form("username"
form_psw = request.form("password"
'register the DLL object and instantiate it as loginOBJ
set loginOBJ = server.createobject("GPN.login"
result = loginOBJ.login_test(form_user, form_psw)
if result = FALSE then
Response.Cookies("UserName"
= ""
response.redirect "messages/login_failed.asp"
else
Response.Cookies("UserName"
= form_user
response.redirect "index.asp"
end if
end if
%>
I am trying to make a "simple" DLL that accepts userid and password in a VB DLL and using that info connecting to a database and testing for a valid login. I wrote the DLL and registered it (I think) and then wrote the ASP to use it, yet I get an object required message. here is the DLL code and following is the ASP code. Any help or pointers greatfully accepted!
=================================
DLL VB Code
=================================
Public Function login_test(user_id, password) As Boolean
Dim objConn, strConnection, objRS, strQuery, Answer
Set objConn = Server.CreateObject("ADODB.Connection"
strConnection = "DSN=secure;Database=secure;UID=secure_login;PWD=simonp;"
objConn.Open strConnection
strQuery = "SELECT * FROM login WHERE userid = '" & user_id & "';"
Set objRS = objConn.Execute(strQuery)
If objRS.EOF = True Then
Answer = False
Else
If objRS("password"
Answer = False
Else
Answer = True
End If
End If
login_test = Answer
End Function
=================================
ASP Code
=================================
<% @LANGUAGE = VBScript %>
<% option explicit
Response.Expires = 0
Dim objConn, objRS, strQuery, loginOBJ, result
Dim strConnection, strBuild, form_psw, database_psw, form_user, database_user
If Request.ServerVariables("CONTENT_LENGTH"
form_user = request.form("username"
form_psw = request.form("password"
'register the DLL object and instantiate it as loginOBJ
set loginOBJ = server.createobject("GPN.login"
result = loginOBJ.login_test(form_user, form_psw)
if result = FALSE then
Response.Cookies("UserName"
response.redirect "messages/login_failed.asp"
else
Response.Cookies("UserName"
response.redirect "index.asp"
end if
end if
%>