Office中国论坛/Access中国论坛

标题: 请教斑竹和各位高手,如何调用sql-server上的自定义函数? [打印本页]

作者: zjxgjp    时间: 2004-11-1 19:44
标题: 请教斑竹和各位高手,如何调用sql-server上的自定义函数?
我在sql-server上定义了一个自定义函数如下:

create FUNCTION dbo.fulltype (@id int)

RETURNS nvarchar(50)

AS

BEGIN

declare @fullname nvarchar(50)

SET @fullname=''  

while @id>0

begin

  set @fullname =(select typename from type where id=@id)+case @fullname when '' then '' else [url=http://www.office-cn.net/vvb/mailt'_'+@fullname]'_'+@fullname[/url] end

  set @id=(select fid from type where id=@id)

end

RETURN @fullname

END

在adp中想调用,如:me.caption=currentproject.connect.execute("fulltype 82" ) 老出错"类型

不匹配",如何解决?该函数已在sql上调试过没问题.




欢迎光临 Office中国论坛/Access中国论坛 (http://www.office-cn.net/) Powered by Discuz! X3.3