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.
| Author |
Topic |
|
pcplayer
Starting Member
5 Posts |
Posted - 2008-03-23 : 00:12:44
|
| I have a question and I hoping to not sound to lame. I am trying to use the sp_oacreate and the sp_oamethed to run my dll from sql sever 2005It looks some thing like thisEXEC @hr = sp_OACreate 'MyApplication.Adcom', @object OUT,5IF @hr <> 0 BEGIN --Not able to create the object Return @hr END --Not able to create the object EXEC @hr = sp_OAMethod @object, 'Authenticate', @FunctionReturn OUT, strUser, strPassword, strDomanIF @hr <> 0 BEGIN --Not able to execute Com function Return @hr END --Not able to execute Com functionI have created my dll in .net and placed it in the root drive of the server. How does OACreate know where to locate my dll?One executing this fucntion I am returning -2147221005-214721148 error code. Have I created my dll incorrectly? The name of the dll is ActiveDirectoryCom and the Class with in the dll is called Adcom and the function that need to run is called AuthenticateUserFullPath. Have I correctly Written the sp_Oa's |
|
|
mfemenel
Professor Frink
1421 Posts |
Posted - 2008-03-23 : 05:31:12
|
| Well it's been a while since I've done this in sql but did you run regserver32? I believe you would need to register your DLL before using it.Regsvr32.exe <DLL PATH>\DLLNAME.dllMike"oh, that monkey is going to pay" |
 |
|
|
jsmith8858
Dr. Cross Join
7423 Posts |
|
|
pcplayer
Starting Member
5 Posts |
Posted - 2008-03-23 : 22:39:39
|
| I have tried to use CRL integration in SQL Server 2005 manage it with CREATE ASSEMBLY statement. However that ole automation application that I am trying to execute with the above stored proceedure has a company web service that is a company standard to do the authentication which I have no contol over, So when I try to execute:CREATE ASSEMBLY ActiveDirectoryCom from 'C:\ActiveDirectoryCom\bin\Release\ActiveDirectoryCom.dll' WITH PERMISSION_SET = SAFE I get this errorMsg 6213, Level 16, State 1, Line 6CREATE ASSEMBLY failed because method "add_LookupUserInfoFromIDCompleted" on type "ActiveDirectoryCom.com.cshPeopleFinder" in safe assembly "ActiveDirectoryCom" has a synchronized attribute. Explicit synchronization is not allowed in safe assemblies.cshPeopleFinder is a webreference to a webservice. I how that there is many other ways to do this however It is requested that I keep this functionality runing with this stored procedure and that the dll remain on the the secure server. |
 |
|
|
|
|
|
|
|