BUG: You receive a runtime error when you call the ASPUtilLib.GetStyles method (325010)



The information in this article applies to:

  • Microsoft Solution Offering - Microsoft Solution for Internet Business

This article was previously published under Q325010

SYMPTOMS

When you work with the ASPUtilLib.GetDictionary object in Microsoft Visual Basic Script (VBS), and you do not use the Set keyword in front of the object variable you are defining, you may receive a runtime error.

CAUSE

This problem occurs when you set the value of a variable to the object type without the Set keyword.

RESOLUTION

Microsoft has confirmed that this is a bug in the Microsoft products that are listed in the "Applies to" section.

WORKAROUND

Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and the tools that are used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements. If you have limited programming experience, you may want to contact a Microsoft Certified Partner or the Microsoft fee-based consulting line at (800) 936-5200. For more information about Microsoft Certified Partners, visit the following Microsoft Web site:For additional information about the support options available from Microsoft, visit the following Microsoft Web site: To work around this problem, use the following VBA code sample that uses the Set keyword to define the object variable that is returned from the ASPUtilLib.GetDictionary object:
'ASPUILIB.ASP

Function GetStyles() 
     Set dictStyles = m_ASPUtilLib.GetDictionary() 
     dictStyles.StandardTextBox = "size='" & STANDARD_TEXTBOX_SIZE_NUMBER &  _
                                                           "'" dictStyles.StandardPasswordBox = "size='" &  _
                                                             STANDARD_TEXTBOX_SIZE_NUMBER & "'" 
     Set GetStyles = dictStyles 
End Function


'ASPUTILLIB.ASP

Public Function GetDictionary() 
     Set GetDictionary = Server.CreateObject("Commerce.Dictionary") 
End Function

Modification Type:MajorLast Reviewed:12/15/2005
Keywords:kbfix kbbug KB325010 kbAudDeveloper kbAudITPRO