PRB: VB Component Not Marked Apartment Produces ASP 0115 Error
ID: Q191979
|
The information in this article applies to:
-
Active Server Pages
-
Microsoft Visual Studio 97
-
Microsoft Visual Basic Standard, Professional, and Enterprise Editions, 32-bit only, for Windows, version 5.0
SYMPTOMS
When instantiating an ActiveX dynamic-link library (DLL) created with
Visual Basic 5.0 within an Active Server Page using the
Server.CreateObject, the following error may occur:
Error 'ASP 0115'
Unexpected error
/<VirtualRoot>/<ASPPage>
A trappable error occurred in an external object. The script cannot
continue running.
RESOLUTION
Apply Visual Studio 97 Service Pack 3 or later to Visual Basic 5.0 and
recompile the ActiveX DLL.
NOTE: Applying the latest version of the service pack will also apply fixes
from the previous versions of the service pack.
Use the following steps to recompile the ActiveX DLL in Visual Basic with
the latest service pack:
- Open the ActiveX DLL project.
- From the menu, select Project and go into <ProjectName> Properties where
<ProjectName> is the name of the ActiveX DLL project.
- In the <ProjectName> - Project Properties dialog box, click the General
tab.
- Go to the Threading Model frame and choose Apartment Threaded in the
combo box. Click OK.
- Recompile ActiveX DLL component and apply it back to the Web server.
- Register the ActiveX DLL component on the Web server using RegSvr32.exe,
if necessary.
NOTE: Apartment-model threading is the recommended threading model for
components that will be called by Active Server Pages.
REFERENCES
For more information on threading support in Internet Information Server
4.0, refer to the following paper "Improving the Performance of Data Access
Components with IIS 4.0," which is available at http://www.microsoft.com/.
For more information on apartment-model threading articles, refer to the
following Microsoft Developers Network site:
http://premium.microsoft.com/msdn/library/
Additional query words:
viasp vb ActiveX dll asp
Keywords : kbASP kbCOMt kbJScript kbScript kbVBScript kbGrpASP
Version : WINDOWS:5.0,97; winnt:
Platform : WINDOWS winnt
Issue type : kbprb