Last post Dec 17, 2009 10:00 AM by atconway
Dec 16, 2009 09:42 PM|netazoid|LINK
I want to access the methods of a dll that is not managed. Seems to be vb6 from my best guess and what I know about the program. That part I have managed to figure out. If I drag the x.dll to my bin folder, the interpreter wrapper is created, etc. I can
access the methods in the dll just fine. The problem is the database connection.
For informational purposes: The dll is compiled for a vbscript .asp website. There are a few methods in the dll that just manipulate the input (which I can access error free- its how I tested the dll usage), but most make a db call to get or set or update,
etc. data in the db. The dll expects an ADODB connection. The asp files are setup such as:
set DllObj = server.CreateObject("dll.class")
set connect = server.createobject("ADODB.Connection")
'call to method in dll here
value = DllObj.method("data1, data2)
It is using a DSN but just as easily could be a DSN-Less connection. My problem is that the dll expects the connection to be open and available to it. Can I make a ADODB database connection available and open for this dll in a vb.net asp.net website. Basically,
I need to use the business logic and db data changes through this dll, but want to make the front end in asp.net.
I know there is an ADODB namespace in .net somwhere and I tried using it but it was not doing the job and really, I did not quite understand how to.
Anybody willing to provide a detailed example of how to do this in VB and VS 2008, .net 3.51, on a Windows server 2008 R2 with IIS7?
Dec 16, 2009 10:46 PM|qwe123kids|LINK
Go page Directive <@page .. AspComptent="true%>
Create Dll in Vb6.0 and Acess it into .Net
Y Are U using Adodb for Databse Btter use datareder.
Dec 17, 2009 10:00 AM|atconway|LINK
I don't know specefically the answer to your question, but I would think you would be able to create a classic ADO connection and persist it for as long as you need even in .NET. While it is not pretty or even reccomended, you can use classic ADO in .NET
to support legacy processes as you are needing to do.
I did however find (2) good resorces with code examples about using the ADODB.dll in .NET. You should take a look to both of them for guidance on using ADO in .NET.
Revisiting the Use of ADO in .NET Applications:
ADODB Services in .NET Applications using VB.NET:
Hope this helps!