Home > object required > object required asp error

Object Required Asp Error

Contents

here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about

800a01a8 Object Required Vbscript

Stack Overflow the company Business Learn more about hiring developers or posting ads with microsoft vbscript runtime error '800a01a8' object required ' undefined ' us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Function Error Object Required 800a01a8 up vote 1 down vote favorite I'm relatively new to functions and classes so not too sure if this is a beginners mistake. I'm getting: Microsoft VBScript runtime error '800a01a8' Object required: 'EngineerNote(...)' /backup-check/backup_frontendlist_import_NEW.asp, line 76 Line 76 is: Set NoteArray=EngineerNote(company, servername, backupsolution) The three variables I'm passing are all strings. All the function and class is set in: Class EngineerNoteClass public note public notesubmitdate End Class Function EngineerNote(Company, ServerName, Solution) Set RecordSet = Server.CreateObject("ADODB.Recordset") RecordSetSQLString = "SELECT note, submitdate FROM tbl_BackupChecks_AuditInformation WHERE Company='" & company & "' AND ServerName='" & servername & "' AND Solution='" & solution & "' ORDER BY submitdate desc;" RecordSet.Open RecordSetSQLString, DatabaseConnection If Recordset.EOF Then 'Do Nothing Else Dim NoteResults Set NoteResults = new EngineerNoteClass noteresults.note = RecordSet("note") noteresults.notesubmitdate = RecordSet("submitdate") Set Engineernote = NoteResults End If Recordset.Close End Function asp-classic vbscript share|improve this question asked Jul 4 '13 at 11:20 Trinitrotoluene 55821126 add a comment| 1 Answer 1 active oldest votes up vote 4 down vote accepted Most likely your database query didn't return any results. You only set the return value of your function when the recordset isn't at EOF: If Recordset.EOF Then 'Do Nothing Else ... Set Engineernote = NoteResults End If Setting the return value to Nothing (or to an empty EngineerNoteClass object) in the Then branch should make the error go away: If Recordset.EOF Then Set EngineerNote = Nothing Else ... Set Engineernote = NoteResults End If Make sure you handle the returned value/object appropriately in the rest of your script. share|improve this answer answered Jul 4 '13 at 13:01 Ansgar Wiechers 86.9k1165104 This was precisely it - bad practice from me there. Thanks a lot! –Trinitrotoluene Jul 4 '13 at 13:11 I w

here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of http://stackoverflow.com/questions/17468979/function-error-object-required-800a01a8 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up ASP Classic VB error 800a01a8 object required up vote 1 down vote favorite I am attempting to fix an issue on a company website. The page in question is http://www.srbc.com/SiteMap.asp. I am getting the following error http://stackoverflow.com/questions/29901536/asp-classic-vb-error-800a01a8-object-required when trying to call a global options file: Microsoft VBScript runtime error '800a01a8' Object required: '' /_Includes/Callout_Global.asp, line 40 And this is the line the error references in the /_Includes/Callout_Global.asp file: rs_main.open "Select TeamID, FirstName + ' ' + LastName as FullName from team where Category = 'Attorney' and IsActive = '1' Order by OrderNum" The code controls the dropdown box that should contain a listing of attorney names. This code works just fine on other pages in the site (see for example http://www.srbc.com/Careers/Default.asp). I am not a coder, just trying to cleanup this site a bit. It is pretty dated code, but any suggestions on what I could do to fix this would be appreciated. The coding on the SiteMap.asp page around where this function is called looks like: