Author Topic: Com  (Read 1858 times)

0 Members and 1 Guest are viewing this topic.

Draftek

  • Guest
Com
« on: April 07, 2010, 04:38:25 PM »
I have a client who wants to code some excel vba and have me develop an autocad drawing.

I'm using a c#.net dll exposed to com.

He wants to pass an ADODB.Recordset to me for processing the requirements for the drawing.

I referenced the com ADODB type library inside my app so I could work with the recordset object.
I wasn't able to pass it from the vba app directly as I kept getting a type mismatch error.
So, I changed the method to accept an object and used casting to extract the recrodset from the object.
In the vba app I simply passed the recordset as a variant.

This works but I gotta believe there is a better way.

Any ideas?

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8801
  • AKA Daniel
Re: Com
« Reply #1 on: April 07, 2010, 07:08:48 PM »
You should be able to use the System.Data.OleDb.OleDbDataAdapter class to fill a DataSet from a ADODB.RecordSet 

Dan

Draftek

  • Guest
Re: Com
« Reply #2 on: April 08, 2010, 07:51:56 AM »
Thanks,
I'll take a look at that.