Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 sp_oa and .Net

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-10-17 : 08:43:14
archngl writes "Has anyone had any success with use sp_oa to instantiate a .Net framework dll? I've gotten the dll strongly name and inserted into the GAC (Global Assembly Cache). I am having no problems calling it from an outside application so I know it's registered in the GAC correctly. I've also placed an entry pointing to the dll in the registry using regasm.exe. When I try to do an sp_OACreate, all I get back is a null value instead of an integer pointer to the object.

Has anyone had any luck with this?"

robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-10-17 : 08:48:17
Don't know if or how this affects .Net components, but sp_OA procedures work with COM objects, which need to have the standard COM interfaces. Your DLL would therefore have to be compiled as an ActiveX DLL, AFAIK. If .Net doesn't allow for this then I don't think you'll be able to use sp_OA with it, except maybe to write a wrapper COM object that can call your current DLL.

The only other way to use a DLL in SQL Server is as an extended stored procedure, but that requires it to be written with all of the ODS headers/constants/declarations included. The header files are included with the SQL Server development tools during install, if you installed them you'll find them in one of the folders in the SQL Server program directory. They're C/C++ headers, and need to be converted for any other language you use to write your DLLs.

.Net integration will occur with the next SQL Server release, Yukon, sometime next year.

Go to Top of Page
   

- Advertisement -