declare @i int
declare @ret int
declare @intRetCode int
exec @intRetCode = sp_OACreate 'Basp21', @i out //Basp21是调用组件的工程命,如果有类名,也要加上
EXEC @intRetCode = sp_OAMethod @i,'sendmail',@ret OUT,'192.168.1.19','xx@xx.net.cn','xx@xxx.net.cn','happy','newyear','' //sendmail是所要调用的函数名
exec sp_OADestroy @i
用COM组件前需要先注册
博客展示了使用COM组件调用函数的代码,包括创建组件实例、调用sendmail函数及销毁实例。代码中涉及调用组件的工程名Basp21,还提到使用COM组件前需要先进行注册。
4582

被折叠的 条评论
为什么被折叠?



