Passing DataTable between ADO and .NET Class

amueller

New member
Joined
Jan 17, 2012
Messages
1
Location
Green Bay, Wisconsin, United States
Programming Experience
5-10
I hope this is the right forum for this post.. If not, please move it to the appropriate area.


I have a VB.NET dll that I created from an ASP.net class from a previous project. I created the dll such that it is interopable with COM so that I could use it in VBA. The container for the new project is VBA, which was why I wanted to do this. Now, I have some functions that use Datatables and pass them back and forth (kinda). Here is an example function:

Public Sub GetProfileAverages(ByVal strHistorianTag As String, ByVal strStartTime As String, ByVal strEndTime As String, ByRef dtMyProfile As DataTable)

In this function I pass the datatable as reference, fill it, then use it in the calling subroutine. That is easy enough in an ASP.NET program, but is this possible when calling a VB.NET dll from VBA? If so, how? If not, what CAN I do?


Thanks in advance!
 
G'd evening amuller,
I think you're out of luck. As you already noticed MS Access doesn't implements datatable type. What you can do is to modify your dll and overload the function, instead of datatable pass a sql string, and a connection string, i guess this kind of modification would have less impact in your project.
G'd luck.
 
Back
Top