ASP數組引用問題﹖請高手指教﹐急(在線等)!

juning 2004-08-11 01:34:02
在VB里做DLL﹐函數參數中需要傳兩個一維數組來生成表格。在VB里測試可以通過﹐但是在ASP里調用DLL時﹐這兩個數組不知道該怎么引用。我把VB里的測試程序COPY到ASP里﹕
<%
set sm=server.CreateObject("IEDSDLL.clsMail")
dim aField(3)
dim aContent(6)
aField(0) = "gonghao"
aField(1) = "name"
aField(2) = "password"
aContent(0) = "123456789"
aContent(1) = "juninglaw"
aContent(2) = "123456"
aContent(3) = "123456789"
aContent(4) = "juning"
aContent(5) = "123456"
sm.SendTable
"juning112233","emailaddress1","emailaddress2","hello","test",aField,aContent
%>
總是提示說”函數形態不符”。不知道是怎么回事。請問一下﹐ASP里是不是不能直接用數組傳值﹐而只能一個一個傳﹖
...全文
92 点赞 收藏 9
写回复
9 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
madpolice 2004-11-05
As String去掉看看
回复
bill1980 2004-11-05
可能是給數組賦值時,沒有統一值的類型.
回复
yeskele 2004-08-11
学习!!!!
找个凳子来坐着等
回复
juning 2004-08-11
dll代碼:
Public Function SendTable(ByVal sMailfrom As String, _
ByVal sMailto As String, _
ByVal sMailcc As String, _
ByVal sSubject As String, _
ByVal sMailmsg As String, _
ByRef aField() As String, _
ByRef aContent() As String)
k = 0
sHtml = "<html>"
sHtml = sHtml & "<head>"
sHtml = sHtml & "<title>AOpen_ERMA</title>"
sHtml = sHtml & "</head>"
sHtml = sHtml & "<body>"
sHtml = sHtml & "<font size='5'><p>"
sHtml = sHtml & sMailmsg
sHtml = sHtml & "<table bgcolor ='#FFFFFF' width='66%' border='0' cellspacing='1' cellpadding='2'>"
sHtml = sHtml & "<tr bgcolor='#7f7fb3'>"
For j = LBound(aField) To UBound(aField) - 1
If aField(j) = "" Then Exit For
sHtml = sHtml & "<td><font color='white'><div align='center'>" & aField(j) & "</div></font></td>"
Next
sHtml = sHtml & "</tr>"
For i = 0 To (UBound(aContent) / UBound(aField)) - 1
If aContent(i) = "" Then Exit For
If (i Mod 2) = 1 Then
sHtml = sHtml & "<tr bgcolor='#f0f0f0'>"
Else
sHtml = sHtml & "<tr bgcolor='#e6e6e6'>"
End If
For j = LBound(aField) To UBound(aField) - 1
n = k + j
sHtml = sHtml & "<td><div align='center'>" & aContent(n) & "</div></td>"
Next
k = k + UBound(aField)
sHtml = sHtml & "</tr>"
Next
sHtml = sHtml & "</table>"
sHtml = sHtml & "<p>" & Date & "</p></font>"
sHtml = sHtml & "</body>"
sHtml = sHtml & "</html>"

Set oMail = CreateObject("CDONTS.NEWMAIL")
oMail.From = sMailfrom
oMail.To = sMailto
oMail.Cc = sMailcc
oMail.Subject = DateValue(Now()) & " " & sSubject
oMail.Body = sHtml
oMail.BodyFormat = 0
oMail.MailFormat = 0
oMail.Send
Set oMail = Nothing

End Function


asp代碼﹕
<%
set sm=server.CreateObject("IEDSDLL.clsMail")
dim aField(3)
dim aContent(6)
aField(0) = "gonghao"
aField(1) = "name"
aField(2) = "password"
aContent(0) = "123456789"
aContent(1) = "juninglaw"
aContent(2) = "123456"
aContent(3) = "123456789"
aContent(4) = "juning"
aContent(5) = "123456"
sm.SendTable
"juning112233","emailaddress1","emailaddress2","hello","test",aField,aContent
%>
望高手指點﹗
回复
juning 2004-08-11
sm.SendTable 参数錯在哪里啊﹖
回复
juning 2004-08-11
VB的函数中参数定義如下﹕
Public Function SendTable(ByVal sMailfrom As String, _
ByVal sMailto As String, _
ByVal sMailcc As String, _
ByVal sSubject As String, _
ByVal sMailmsg As String, _
ByRef aField() As String, _
ByRef aContent() As String)
回复
jzywh 2004-08-11
sm.SendTable 参数错误
回复

dim afield(2)
dim acontent(5)

不知道管用不~~
回复
hthunter 2004-08-11
你在VB的函数中参数是如何定义的?
回复
相关推荐
发帖
ASP
创建于2007-09-28

2.8w+

社区成员

ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
申请成为版主
帖子事件
创建了帖子
2004-08-11 01:34
社区公告
暂无公告