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!

I am attempting to execute an extended stored procedure(XP) using quer

Status
Not open for further replies.

Lorraine

Programmer
Aug 9, 2000
7
0
0
US
I am attempting to execute an extended stored procedure(XP) using query analyzer. <br><br>The XP is registered in the master database.&nbsp;&nbsp;The dll and pdb files for the XP are in the mssql7/binn directory.<br><br>However, when I execute, I get the following error:<br><br>&quot;Cannot find the function xp_test in the library C:\MSSQL7\Binn\test.dll. Reason: 127(The specified procedure could not be found.)&quot;.<br><br>I have also tried debugging in Visual C++.&nbsp;&nbsp;After I stop the mssql as a service and start it via the C++ debugging options, I execute with the following error message in the DOS screen:<br><br>&quot;Using '(dll name is in quotes)' version 'UNKNOWN' to execute extended stored procedure '(XP name is in quotes)'.<br><br>Any ideas on what could be causing this problem?<br>
 
Lorraine,
I had a similar problem.
MS VC++ was mangling the function name. So, the function ended up with @ signs and other characters in it.

To solve it, use a .DEF file and specify the function names you are exporting.
EG. (NB. the two functions prefixed with uxp_ are the actual extended stored procedures)
LIBRARY icRedExStoredProc
DESCRIPTION 'icRed - SQL Server Extended Stored Procedure - DLL'
EXPORTS
DllMain
__GetXpVersion
uxp_icRedSetBuildingLights
uxp_icRedGetVersion

good luck,
Grant. [sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top