Strange ADODB.Recordset marshalling? error

DimkaNewtown

Active member
Joined
Jan 21, 2003
Messages
43
Location
New York City
I have a client application written in C# that utilizes a Business Logic Layer written in VB6.0 which utilizes Data Access Layer written in VB6.0.

The application worked fine up until I started getting this error "Unspecified Error" which is a System.Runtime.InteropServices.COMException.

Heres is the code:
C#:
private void LoadShippingData()
{
	Recordset rs = null;

	try
	{
		Global.CS.GetShippingRequestData( Global.ConnectString, ref rs, ref _SRID );	
		if( rs.Fields["Carrier"].Value.ToString() != "FedEx" )
			cmbShippingCarrier.SelectedIndex = 1;
		else
			cmbShippingCarrier.SelectedIndex = 0;
				
		rs.Close();

		LV_ShippingItems.Items.Clear();

				
		Global.CS.GetShippingRequestDetails( Global.ConnectString, ref rs, ref _SRID );
				
		object oEquipID;
		ListViewItem lvi;

		Recordset rsEquip = new Recordset();
		while( !rs.EOF )
		{
			oEquipID = rs.Fields["EquipID"].Value;
			Global.CS.GetEquipData( Global.ConnectString, ref rsEquip, ref oEquipID );

			if( !rsEquip.EOF )
			{
				lvi = new ListViewItem();
				lvi.BackColor = LV_ShippingItems.BackColor;
				lvi.Tag = rs.Fields["s_GUID"].Value;
				lvi.Text = rsEquip.Fields["SN"].Value.ToString();
				lvi.SubItems.Add( rsEquip.Fields["LotNum"].Value.ToString() );
				lvi.SubItems.Add( rsEquip.Fields["ModelName"].Value.ToString() );

				try
				{
					lvi.SubItems.Add( DateTime.Parse(rsEquip.Fields["ExpDate"].Value.ToString()).ToString("MM/dd/yyyy"));
				}
				catch
				{
				}
				finally
				{
					LV_ShippingItems.Items.Add( lvi );
				}
			}

			rs.MoveNext();
		}
	}
	catch( Exception ex )
	{
		Global.HandleError( this.Name, "LoadShippingData", ex.InnerException + "\n" + ex.Message + "\n" + ex.Source + "\n" + ex.StackTrace );
	}

	return;
}

it happens on this line
C#:
Global.CS.GetShippingRequestDetails( Global.ConnectString, ref rs, ref _SRID );

The strangest thing is that this function is called to refresh a ListView after an item has been added or deleted and it works correctly the first time without a hitch. The second time around the exception is thrown on the line I wrote above.

After that every single call to the COM object fails.

This is getting ridiculous. :(

Has anyone encountered this before?
 
I fiigured out the problem.

This requires a hotfix from Microsoft. The code shown above is not the problem. THe problem occurs in a nother part of my code where a SORTED ADO Recordset is transformed into a DataSet through OleDbAdapter.Fill() method. There is documentation in the knowledge-base but they refer to FILTERED recordsets.

Anyway. You have to call Microsoft support, theyll need a bunch of keys from the registry to build a custom hotfix for your computer. They told me its tough **** if you need to distribute this app :mad: :mad: but they promised it will be included in the next service pack.


BTW, this problem only applies to .NET Framework 1.1, in 1.0 it works correctly. :mad: :mad: :mad:
 
Back
Top