For Programmers: Free Programming Magazines  


Home > Archive > ASP > August 2005 > Odd "Invalid class string" error









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Odd "Invalid class string" error
verb13@hotmail.com

2005-08-25, 6:55 pm

In an asp page in localhost I have this:
Set x = Server.CreateObject("Scripting.Dictionary")
And I get this error: Invalid class string
If I omit Server like this:
Set x = Server.CreateObject("Scripting.Dictionary")
I get this error: ActiveX component can't create object:
'Scripting.Dictionary'

In the same asp page this works fine:
Set conn = Server.CreateObject("ADODB.Connection")

In a Visual Basic application this works fine, too:
Set x = CreateObject("Scripting.Dictionary")

I reinstalled VB without success. Why do I get "Invalid class string"
in the first case?

Steven Burn

2005-08-25, 6:55 pm

Dim sObject
sObject = "Scripting.Dictionary"
On Error Resume Next
If IsObject(CreateObject(sObject)) Then
Response.Write "Creation of object [ " & sObject & " ] was successful"
Set sObject = Nothing
'// Your code here
Else
'// Woops, somethings wrong
Response.Write "Sorry, " & sObject & " is not available on this server."
& _
"Confirm the required files for this class are
present and registered."
End If

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

<verb13@hotmail.com> wrote in message
news:1125003880.209069.282360@g49g2000cwa.googlegroups.com...
> In an asp page in localhost I have this:
> Set x = Server.CreateObject("Scripting.Dictionary")
> And I get this error: Invalid class string
> If I omit Server like this:
> Set x = Server.CreateObject("Scripting.Dictionary")
> I get this error: ActiveX component can't create object:
> 'Scripting.Dictionary'
>
> In the same asp page this works fine:
> Set conn = Server.CreateObject("ADODB.Connection")
>
> In a Visual Basic application this works fine, too:
> Set x = CreateObject("Scripting.Dictionary")
>
> I reinstalled VB without success. Why do I get "Invalid class string"
> in the first case?
>



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com