PC Review Forums Newsgroups Microsoft DotNet Microsoft ADO .NET Serviced Component, Excel and OleDbConnection.Open

Reply

Serviced Component, Excel and OleDbConnection.Open

 
Thread Tools Rate Thread
Old 28-11-2005, 07:34 PM   #1
josef@wainz.net
Guest
 
Posts: n/a
Default Serviced Component, Excel and OleDbConnection.Open


I'm using the OleDbConnection object to retrieve the contents of an
Excel Worksheet as a DataSet. This works fine when testing the
MyExcel.GetMonthly() method call.

When I call MyExcel.GetMonthly() from a Serviced Component, it bombs.

Code snippet:

OleDbConnection cn = new OleDbConnection(CnString);
cn.Open(); <-- Error occurs here

In an effort to isolate the problem I created a new class and called
MyExcel.GetMonthly() from it. Without ServicedComponent inheritence it
works fine. With ServicedComponent inheritence it crashes with:

A condition has occurred that indicates this COM+ application is in
an unstable state or is
not functioning correctly. Assertion Failure: !m_punk

Server Application ID: {6E4E5709-D807-46DD-819E-2B3D150FC547}
Server Application Instance ID:
{C73018C7-1BB0-4DB2-A9DB-4D9E22521507}
Server Application Name: MSRBLL
The serious nature of this error has caused the process to
terminate.
COM+ Services Internals Information:
File: d:\qxp_slp\com\com1x\src\comsvcs\jit\jit.cpp, Line: 858
Comsvcs.dll file version: ENU 2001.12.4414.258 shp

Any thoughts?

  Reply With Quote
Old 01-12-2005, 03:19 PM   #2
josef@wainz.net
Guest
 
Posts: n/a
Default Re: Serviced Component, Excel and OleDbConnection.Open

Guess I'll answer my own post

To ways to solve this problem:
1.) Put the assembly in the GAC
2.) Put the class that works directly with Excel in it's own
Class Library project. It doesn't need to inherit from
ServicedComponent,
only the rest of the Data Acess Layer needed COM+.

  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off