Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calling a DLL from a stored procedure

Status
Not open for further replies.

wbodger

Programmer
Apr 23, 2007
769
0
0
US
I am having one last issue with a database server that I had to bring online hurriedly last week. One of the functions of this server is to create Serial Numbers using Armadillo software. It worked fine on the old server (which was setup and running before I got here) and the only instruction that I was given (there is no documentation) was that I just had to put the DLL in the path on a new server and it would work. Well... It does not appear to be so. The specific piece of code that I have that calls the DLL is

Code:
exec @rt = sp_OACreate 'CodeGenAX.CodeGenDLL.1', @kg OUTPUT

I have CodeGen.DLL in system32 and sysWOW64. I have run Depends to check for dependencies and I get the exact same results on the old machine that works as on a machine that does not work. And that result is

Code:
OLE Automation Error Information
  HRESULT: 0x800401F3
  Source: ODSOLE Extended Procedure
  Description:  Invalid class string
error! 1

I have verified that sp_OACreate is there, odsole70.dll and made sure that the path is correct. I am now out of ideas. Has anybody else out there had an issue like this? Have you found anything that works?

Thanks,
Willie
 
No, if you just "put" the DLL in the path it wont work.
This is a COM Server and it SHOULD be registered.
So put that DLL whereever you want and then run:
regsvr32 (full path here)YourDLL.DLL

Keep in mind that this is a 32 bit command.
If the DLL is 64 bit you should run other REGSVR command.

Borislav Borissov
VFP9 SP2, SQL Server 2000,2005 & 2008.
 
So, apparently there is more to the story (as I just found out, sorry). CodeGen.dll is from Armadillo, CodeGenAX.dll is an ActiveX wrapper that somebody built. So, I went and tried to register the CodeGenAX.dll, verified that it was there in system32 (it is 32-bit and on a 32-bit machine for this testing) and it tells me that

Code:
LoadLibrary("CodeGenAX.dll") failed - The specified module could not be found.

I tried it from the system32 directory, I tried specifying the full path with the same result. Still stumped. Have I missed something else?

Willie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top