Trying to pass a Table to a VB.Net Class

G

Guest

Hello -

From an Access VBA module, I'm trying to pass a Table to a VB.Net class.

I'm getting the following error running the VBA:

"Unable to cast object of type System._ComObject to type
System.Data.Datatable"

The code resulting in the error looks like the following
In VBA:
Dim mclass As myClass
Set mclass = New myClass

Set mclass.ContractTable = CurrentDb().OpenRecordset("Contract")

In VB.Net:

Public Class myClass

Private myrstContract As Data.DataTable

WriteOnly Property ContractTable() As DataTable
Set(ByVal Value As DataTable)
myrstContract = Value
End Set
End Property

End Class

Suggestions?

Thank you as always,
Mark
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top