Odd "Invalid class string" error

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • verb13@hotmail.com

    Odd "Invalid class string" error

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

    In the same asp page this works fine:
    Set conn = Server.CreateOb ject("ADODB.Con nection")

    In a Visual Basic application this works fine, too:
    Set x = CreateObject("S cripting.Dictio nary")

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

  • Steven Burn

    #2
    Re: Odd "Invali d class string" error

    Dim sObject
    sObject = "Scripting.Dict ionary"
    On Error Resume Next
    If IsObject(Create Object(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


    Keeping it FREE!

    <verb13@hotmail .com> wrote in message
    news:1125003880 .209069.282360@ g49g2000cwa.goo glegroups.com.. .[color=blue]
    > In an asp page in localhost I have this:
    > Set x = Server.CreateOb ject("Scripting .Dictionary")
    > And I get this error: Invalid class string
    > If I omit Server like this:
    > Set x = Server.CreateOb ject("Scripting .Dictionary")
    > I get this error: ActiveX component can't create object:
    > 'Scripting.Dict ionary'
    >
    > In the same asp page this works fine:
    > Set conn = Server.CreateOb ject("ADODB.Con nection")
    >
    > In a Visual Basic application this works fine, too:
    > Set x = CreateObject("S cripting.Dictio nary")
    >
    > I reinstalled VB without success. Why do I get "Invalid class string"
    > in the first case?
    >[/color]


    Comment

    Working...