Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Can't Create Instance of Object

 
Logged in as: Guest
arrSession:exec spGetSession 2,3,40
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> ASP >> Can't Create Instance of Object
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Can't Create Instance of Object - 5/23/2001 7:56:50 AM   
  rahul27

 

Posts: 19
Score: 0
Joined: 5/23/2001
From: India
Status: offline
Hi,

Would anybody know why I can't create an instance of an object utilizing the New operator? My ASP engine runs standard ASP code okay, but when I add the New keyword, it complains about the syntax. This is the weirdest thing. I've checked the syntax in books and on sites. Following is some code that I copied straight from a website just to test.

<html><head><title></title></head>
<body>
<%


Dim str ' some string that needs to have certain words
' replaced with other words
str = "Apache Rules"
Dim objRegExp
Set objRegExp = New RegExp SYNTAX COMPLAINT

objRegExp.IgnoreCase = True
objRegExp.Global = True

'Replace all instances of Apache with IIS
objRegExp.Pattern = "\bApache\b"
str = objRegExp.Replace(str, "IIS")

'Repalce all instances of Perl with ASP
objRegExp.Pattern = "\bPerl\b"
str = objRegExp.Replace(str, "ASP")

Set objRegExp = Nothing 'Clean up!

response.write str

%>

</body>
</html>
 
 
Post #: 1
 
 Re: Can't Create Instance of Object - 5/23/2001 8:00:06 AM   
  ekiko

 

Posts: 14
Score: 0
Joined: 5/23/2001
From: New Zealand
Status: offline
looks like vb code to me --

You should probably use a

set objRegExp = server.createObject("objectID")

Where object id is the parent library followed by a dot(.) and then the actual object --

such as

set rs = server.createobject("ADODB.Recordset")

I don't use regexp, so I don't know what needs to go in there, but that's where you're going wrong -- and you probably know what should go in there.

(in reply to rahul27)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> ASP >> Can't Create Instance of Object Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts