以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  高级功能研发区  (http://weistock.com/bbs/list.asp?boardid=5)
----  如何通过自定义函数,取数据库字段,并返回序列数据?  (http://weistock.com/bbs/dispbbs.asp?boardid=5&id=51769)

--  作者:ljact
--  发布时间:2013/5/7 22:59:42
--  如何通过自定义函数,取数据库字段,并返回序列数据?

下面这段代码可以取到数据库中的字段,但无法做为自定义函数的值返回,请教一下为什么?应该如何改?
Function ZYYXYZYQ(Formula,N)

    ZYYXYZYQ=0
Set adoConn=CreateObject("Adodb.Connection")
adoConn.Open"Provider=MSDAORA.1;Password=***;User ID=user;Data Source=fdc"

str="SELECT * from zyyxdb.GG_ORG_LIST"
adoConn.Execute(str)

Set rstTmp=CreateObject("ADODB.RecordSet")
rstTmp.open str,adoConn

  Dim aa
  Redim aa(UBound(N))

aa=rstTmp("ORG_CLASS")
ZYYXYZYQ=aa
\'call application.MsgOut(aa)

End Function


--  作者:guotx2010
--  发布时间:2013/5/8 8:36:52
--  
http://www.weistock.com/bbs/dispbbs.asp?boardid=5&Id=401


--  作者:ljact
--  发布时间:2013/5/8 15:39:12
--  
这个贴子是在PEL中直接实现,我是想通过自定义函数,在VBS中实现。没人知道吗?