Variable is undefined: 'OpenConn' VBScript runtime error '800a01f4'

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nitewriter
    New Member
    • Nov 2008
    • 2

    Variable is undefined: 'OpenConn' VBScript runtime error '800a01f4'

    Hi,

    Can someone help me with this scripts, it works on a different server but gives me error now,

    This is the error I now get
    Microsoft VBScript runtime error '800a01f4'

    Variable is undefined: 'OpenConn'

    /customer/authenticate.as p, line 17

    Code:
    <%@LANGUAGE="VBScript"%>
    <%OPTION EXPLICIT%>
    <%Response.Buffer = true%>
    <!--#Include file="includes/utilities.asp"-->
    <%	ON ERROR GOTO 0
    	''-----------------------------------------------
    	'' Login page for simple ASP validation
    	''-----------------------------------------------
    	Dim UserId, Password
    	UserID = Trim(Request.Form("UserID"))
    	Password = Request.Form("Password")
    	VerifyUser UserID, Password   ''''USER-CREATED SUB
    
    '''==================================================
    SUB VerifyUser (UserID, Password)
    	Dim objConn, sql, rs
    	Set objConn = OpenConn()
    
    	sql = "SELECT * FROM tblClients WHERE UserID = '" & UserID & "'"
    	Set rs = Server.CreateObject("ADODB.Recordset")
    	Set rs = objConn.Execute(sql,,1)
    
    	If rs.EOF and rs.BOF Then
    		'''Error! User Not found
    		CleanUp rs
    		CleanUp objConn
    		Response.Redirect "cbaLoginError.asp"
    	Else
    		If rs("Pass") <> Password Then
    		''''Oops!! Incorrect Password ----------
    			CleanUp rs
    			CleanUp objConn
    			Response.Redirect "LoginError.asp"
    		Else
    			''Checking if the account has been created.
    			if(rs("CreateStatus")=1 OR rs("Status")= 2) then
    				Response.Redirect "AccountDisabled.asp"
    			end if
    			''-----------------------------------------
    			Session("UserID") = UCase(rs("UserID"))
    			'Session("UserAccess") = CInt(rs("AccessLevel"))
    			Response.Redirect "custHome.asp"	''always, for all accesslevels!
    			''''' Logins audit code here -----------------
    			''IF CInt(rs("AccessLevel"))=77 THEN
    			'	Response.Redirect "includes/msg.asp?msg=<tr><td>You do not have permission to log into the CMS System</td></tr>"
    			'ELSE
    			'	Response.Redirect "Home.asp"	''always, for all accesslevels!
    			'END IF
    			'''---------------------------------------------
    		End If
    		CleanUp rs
    		CleanUp objConn
    	End If
    	CleanUp rs
    	CleanUp objConn
    END SUB
    '''===================================================
    %>
    Last edited by jhardman; Nov 13 '08, 04:49 PM. Reason: put code in code tags. please note button marked #
  • jhardman
    Recognized Expert Specialist
    • Jan 2007
    • 3405

    #2
    Code:
    	Set objConn = OpenConn()
    This line doesn't make sense. It should be more like this:
    Code:
    set objConn = server.createobject("adodb.connection")
    OpenConn() doesn't mean anything, as far as I know, and the error just means that the server couldn't figure out what it meant either. Perhaps it refers to something in the global.asa file that was not transferred to this server. Now that I think of it, there is more code missing since there is no indication here that you have opened the db connection or specified where you want to connect. Check the global.asa file from the previous server and see if there is a function called OpenConn() that you can copy over.

    Jared

    BTW, please put your code in code tags, there is a button marked # provided

    Comment

    • nitewriter
      New Member
      • Nov 2008
      • 2

      #3
      Thanks, i have been able to figure it out.

      The OpenConn function statement in the includes\utilit ies.asp file is missing, added the statement and script running fine.

      Thanks

      Comment

      • jhardman
        Recognized Expert Specialist
        • Jan 2007
        • 3405

        #4
        glad you found it.

        Jared

        Comment

        Working...