Odd "Invalid class string" error

V

verb13

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?
 
S

Steven Burn

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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,021
Latest member
AkilahJaim

Latest Threads

Top