Asp Object Required 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 object required error in javascript this site About Us Learn more about Stack Overflow the company Business
Classic Asp Object Required
Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask
800a01a8 Object Required Vbscript
Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign
Microsoft Vbscript Runtime Error Object Required
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 vbscript object required 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/o
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 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up VBScript http://stackoverflow.com/questions/17468979/function-error-object-required-800a01a8 Object Required When Trying to set DateTime up vote -1 down vote favorite I am new to VBScript and can't figure out why I'm getting an Object Required error with my code. It's very simple right now, I've just begun it: <% set fs=Server.CreateObject("Scripting.FileSystemObject") Dim dateandtime On Error Resume Next set dateandtime = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss") If Err <> 0 Then ' File operation(s) failed, http://stackoverflow.com/questions/23645754/vbscript-object-required-when-trying-to-set-datetime handle the error response.write(Err.Description) End If %> Why am I not able to set the DateTime? I've set the FileSystemObject for use later in the code FYI. I'm just putting it all in here so you see exactly what I have. I figure it's a simple syntax thing but I can't seem to find the answer anywhere. Thanks for your help! vbscript asp-classic share|improve this question asked May 14 '14 at 4:40 MillerMedia 1,088104190 possible duplicate of "Object required" when using Set in an assignment –Lankymart May 14 '14 at 8:35 1 Same issue use of Set on data types that are not objects (in VBScript). Also use of .Net syntax DateTime.Now.ToString() should be Now() for Classic ASP equivalent or a custom date format. See Answer to Classic ASP - Format current date and time. –Lankymart May 14 '14 at 8:38 add a comment| 2 Answers 2 active oldest votes up vote 2 down vote accepted The first mistake is to use Set when assigning a non-object to a variable. The last entry in the 'Related' list “Object required” when using Set in an assignment deals wi
error '800a01a8' Page 1 of 1 New Topic/Question Reply 2 Replies - 6323 Views - Last Post: 24 June 2010 - 02:11 PM Rate Topic: #1 codeladySRQ New D.I.C Head Reputation: 0 Posts: 6 Joined: 16-June 10 Classic ASP Object Required Error Posted 17 June 2010 http://www.dreamincode.net/forums/topic/178111-classic-asp-object-required-error/ - 07:45 AM I am a novice programmer. I have never learned Classic ASP (or any server-side programs). I am trying to open and read a text file and read the IP addresses in the file and allow only the IP addresses in the file access to the server and deny all else. Line 42 is: If Contents.InStr(pIP) > 0 Then pIP is in the text file along with the IP addresses. I would rather do this via object required code than access lists on the router. But I keep getting this error: Microsoft VBScript runtime error '800a01a8' Object required: 'Contents' /Folder/ValidAddressList.asp, line 42 Here is my code: FUNCTION ValidIPs(pIP) Const Filename = "/Folder/ipaddress.txt" ' file of ip addresses to read Const ForReading = 1, ForWriting = 2, ForAppending = 3 Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0 ' create a filesystem object Dim FSO set FSO = server.CreateObject("Scripting.FileSystemObject") ' map the logical path to asp object required the physical system path Dim Filepath Filepath = Server.MapPath(Filename) IF FSO.FileExists(Filepath) Then Set TextStream = FSO.OpenTextFile(Filepath, ForReading, False, TristateUseDefault) ' read file in one hit, then close text file Dim Contents ' Dim position ' Position=instr(1, contents, pIP,comparemethod.text) 'if isObject(Contents) then ' set objectName = nothing 'end if ' Set Contents = nothing ' Set Contents.InStr(pIP) = nothing Contents = TextStream.ReadAll If Contents.InStr(pIP) > 0 Then ValidIPs = true Else ValidIPs = false End If TextStream.Close Set TextStream = nothing ELSE ' close file TextStream.Close Set FSO = nothing END IF END FUNCTION %> Is This A Good Question/Topic? 0 Back to top MultiQuote Quote + Reply Replies To: Classic ASP Object Required Error #2 Martyr2 Programming Theoretician Reputation: 4953 Posts: 13,362 Joined: 18-April 07 Re: Classic ASP Object Required Error Posted 17 June 2010 - 03:27 PM In classic asp we are still back on functions, not objects. So InStr is a stand alone function, not a method of a string object. So you want to do... If Instr(Contents, "IP Address to look for") > 0 then ' They were found in file, so do something. Else ' Not found End if I see you had some of that there and it is commented out. But that is how you use Instr in classic ASP. P.S. The reason it is erroring out is that contents is a string and in VBScri