您的位置:首页 > 数据库

SQL存储过程调用DLL

2006-12-30 15:50 316 查看
dll程序源码为:
头文件:
#ifndef UNIT1H
#define UNIT1H
extern "C" __declspec(dllexport) __stdcall void messbox();
#endif

cpp文件:
#include <vcl.h>
#include <windows.h>
#pragma hdrstop
#include "unit1.h"

#pragma argsused
int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void* lpReserved)
{
return 1;
}
//---------------------------------------------------------------------------
void __stdcall test()
{
/*测试代码*/
}

make后,把生成的DLL放入了system32目录下。

然后在查询分析器里执行:
sp_addextendedproc 'test' , 'Project1.dll'
exec test

注意:SQL调用扩展存储过程不能有与用户交互的信息(因为是不可能弹出任何窗口的)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: