Object Required Error In Classic Asp
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions
800a01a8 Object Required Vbscript
you might have Meta Discuss the workings and policies of this microsoft vbscript runtime error '800a01a8' object required ' undefined ' site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers
Microsoft Vbscript Runtime Error 800a01a8 Object Required Session
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 vbscript object required string: community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up ASP Object required up vote 0 down vote favorite I have the error in Classic ASP: Microsoft VBScript runtime error '800a01a8' Object required: 'SqlStatement' /Data/Database.asp, line 186 The line 186 is: SqlStatement.CommandText = sql. Here is my code: Dim Db, SqlStatement, RS Set Db = Nothing Set SqlStatement = Nothing Set RS = Nothing ' Initialize the database once Private Sub SqlInitDb() If isNull(Db) Or varType(Db) = vbEmpty Or IsObject(Db) = False Then ' Create database connection object Set Db = Server.CreateObject("ADODB.Connection") ' Set connection timeout Db.ConnectionTimeout = Session("ConnectionTimeout") ' Set command timeout Db.CommandTimeout = Session("CommandTimeout") ' Open database Db.Open Session("ConnectionString") End If If isNull(SqlStatement) Or varType(SqlStatement) = vbEmpty Or IsObject(SqlStatement) = False Then ' Create a sql statement Set SqlStatement = Server.CreateObject("ADODB.Command") ' Set opened database as active connection for the SQL statement SqlStatement.ActiveConnection = Db End If End Sub ' Close the database if it is not closed Private Sub SqlClose() If Not isNull(SqlStatement) And varType(SqlStatement) <> vbEmpty And IsObject(SqlStatement) = True Then SqlStatement.ActiveConnection.Close End If Set SqlStatement = Nothing If Not isNull(Db) And varType(Db) <> vbEmpty And IsObject(Db) = True Then For Each objErr In Db.Errors response.write("
") resp
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 6.2 million programmers, just like you, http://stackoverflow.com/questions/15973411/asp-object-required helping each other. Join them; it only takes a minute: Sign up Error Type: Microsoft VBScript runtime (0x800A01A8) Object required in asp up vote 0 down vote favorite I m new asp.. And tried to access with code But it shows error like this., Error Type: Microsoft VBScript runtime (0x800A01A8) Object required: '' on line 163 The http://stackoverflow.com/questions/30543119/error-type-microsoft-vbscript-runtime-0x800a01a8-object-required-in-asp error showed because of this lines, <% do while not getgroups2.eof pkOrgGroups2=getgroups2("pkOrgGroups") ogGroup2=getgroups2("ogGroup") ogLogo2 =getgroups2("ogLogo") %> May i know for which reason of my code it shows like this? Thanks in advance. vbscript asp-classic share|improve this question edited May 30 '15 at 7:14 asked May 30 '15 at 6:35 sandhu 5211 Pretty sure that's classic ASP, not ASP.NET. They are two different things.... –Tim May 30 '15 at 6:39 @Tim: i edited my post.. –sandhu May 30 '15 at 7:14 add a comment| 1 Answer 1 active oldest votes up vote 1 down vote accepted There are two sure ways to get an "Object required" error: Trying to use Set when assigning a non-object: >> Set x = "non-object/string" >> Error Number: 424 Error Description: Object required Trying to call a method on a non-object: >> WScript.Echo TypeName(x) >> If x.eof Then x = "whatever" >> Empty Error Number: 424 Error Description: Object required or: >> x = "nix" >> WScript.Echo TypeName(x) >> If x.eof
error '800a01a8' Page 1 of 1 New Topic/Question Reply 2 Replies - 6362 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 http://www.dreamincode.net/forums/topic/178111-classic-asp-object-required-error/ 10 Classic ASP Object Required Error Posted 17 June 2010 - 07:45 AM http://forums.devshed.com/asp-programming-51/setting-variable-returns-object-required-567125.html 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 object required Contents.InStr(pIP) > 0 Then pIP is in the text file along with the IP addresses. I would rather do this via 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 = 800a01a8 object required 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 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: 4954 Posts: 13,366 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
Search Username Password Remember Me? Register Lost Password? facebook google twitter rss Free Web Developer Tools Advanced Search Forum Programming Languages - More ASP Programming Setting variable returns Object Required? Thread: Setting variable returns Object Required? Share This Thread Tweet This + 1 this Post To Linkedin Subscribe to this Thread Subscribe to This Thread October 29th, 2008,01:13 PM #1 Xenus View Profile View Forum Posts Contributing User Devshed Novice (500 - 999 posts) Join Date Jun 2004 Location Toronto, Canada Posts 536 Rep Power 182 Setting variable returns Object Required? Hey, I'm pretty new to ASP, so I must be missing something with the syntax here. All I want to do is create a count within a while loop, so, before the loop begins, I do this: Dim Count Set Count = 1 This returns Microsoft VBScript runtime error '800a01a8' (Object required: '[number: 1]') I'm sure this is simple, I'm not having any luck finding an answer to such a simple question though. If you need more of the code, let me know, but I suspect there's jsut something I've missed. Thanks in advance! Faq Reply With Quote October 29th, 2008,06:42 PM #2 No Profile Picture Ronster View Profile View Forum Posts Contributing User Devshed Newbie (0 - 499 posts) Join Date Feb 2007 Location Charlotte Posts 412 Rep Power 146 Originally Posted by Xenus Dim Count Set Count = 1 It *is* very simple. You DON'T need the Set. Just say: Code: Count = 1 "Set" is for a different use, not just simple variable assignment... look here where it is defined: http://asp3wiki.wrox.com/wiki/d-10-0-miscellaneous-functions-statements-and-keywords That site is where I got my start learning Classic ASP a year ago. It has some great tutorials on it. Faq Reply With Quote October 29th, 2008,06:45 PM #3 Xenus View Profile View Forum Posts Contributing User Devshed Novice (500 - 999 posts) Join Date Jun 2004 Location Toronto, Canada Posts 536 Rep Power 182 Weird, I thought I'd tried that (didn't make sense that the Set was required but I'd sene it elsewh