By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,929 Members | 634 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,929 IT Pros & Developers. It's quick & easy.

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

P: 2
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.asp, line 17

Expand|Select|Wrap|Line Numbers
  1. <%@LANGUAGE="VBScript"%>
  2. <%OPTION EXPLICIT%>
  3. <%Response.Buffer = true%>
  4. <!--#Include file="includes/utilities.asp"-->
  5. <%    ON ERROR GOTO 0
  6.     ''-----------------------------------------------
  7.     '' Login page for simple ASP validation
  8.     ''-----------------------------------------------
  9.     Dim UserId, Password
  10.     UserID = Trim(Request.Form("UserID"))
  11.     Password = Request.Form("Password")
  12.     VerifyUser UserID, Password   ''''USER-CREATED SUB
  13.  
  14. '''==================================================
  15. SUB VerifyUser (UserID, Password)
  16.     Dim objConn, sql, rs
  17.     Set objConn = OpenConn()
  18.  
  19.     sql = "SELECT * FROM tblClients WHERE UserID = '" & UserID & "'"
  20.     Set rs = Server.CreateObject("ADODB.Recordset")
  21.     Set rs = objConn.Execute(sql,,1)
  22.  
  23.     If rs.EOF and rs.BOF Then
  24.         '''Error! User Not found
  25.         CleanUp rs
  26.         CleanUp objConn
  27.         Response.Redirect "cbaLoginError.asp"
  28.     Else
  29.         If rs("Pass") <> Password Then
  30.         ''''Oops!! Incorrect Password ----------
  31.             CleanUp rs
  32.             CleanUp objConn
  33.             Response.Redirect "LoginError.asp"
  34.         Else
  35.             ''Checking if the account has been created.
  36.             if(rs("CreateStatus")=1 OR rs("Status")= 2) then
  37.                 Response.Redirect "AccountDisabled.asp"
  38.             end if
  39.             ''-----------------------------------------
  40.             Session("UserID") = UCase(rs("UserID"))
  41.             'Session("UserAccess") = CInt(rs("AccessLevel"))
  42.             Response.Redirect "custHome.asp"    ''always, for all accesslevels!
  43.             ''''' Logins audit code here -----------------
  44.             ''IF CInt(rs("AccessLevel"))=77 THEN
  45.             '    Response.Redirect "includes/msg.asp?msg=<tr><td>You do not have permission to log into the CMS System</td></tr>"
  46.             'ELSE
  47.             '    Response.Redirect "Home.asp"    ''always, for all accesslevels!
  48.             'END IF
  49.             '''---------------------------------------------
  50.         End If
  51.         CleanUp rs
  52.         CleanUp objConn
  53.     End If
  54.     CleanUp rs
  55.     CleanUp objConn
  56. END SUB
  57. '''===================================================
  58. %>
Nov 13 '08 #1
Share this Question
Share on Google+
3 Replies


jhardman
Expert 2.5K+
P: 3,405
Expand|Select|Wrap|Line Numbers
  1.     Set objConn = OpenConn()
  2.  
This line doesn't make sense. It should be more like this:
Expand|Select|Wrap|Line Numbers
  1. 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
Nov 13 '08 #2

P: 2
Thanks, i have been able to figure it out.

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

Thanks
Nov 14 '08 #3

jhardman
Expert 2.5K+
P: 3,405
glad you found it.

Jared
Nov 14 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.