| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 448 人关注过本帖
标题:[求助] if问题 请各位家人看看?
只看楼主 加入收藏
ali8848
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2006-11-20
收藏
 问题点数:0 回复次数:2 
[求助] if问题 请各位家人看看?

'请版主和各位家人帮忙看看.谢谢
'问题在
---------------------------------------------------
号处标出

..........................头部略
Function ShowDownAddress(softid)

Dim rsAddress, sqlAddress, rsDown
Dim DownText,showdown
Dim DownloadName, DownloadPath
Dim DownAddress

If ErrMsg>"" Then
----------------------------
'ErrMsg>"" 这里我不知到该怎么用.,刚学几天ASP
'我是想在 有 下载错误提示ErrMsg值时不执行以下代码,没有提示时执行这段代码.
'请版主和家人帮看看,先谢谢了


'On Error Resume Next
showdown = Newasp.ChkNumeric(Newasp.HtmlSetting(1))

Set rsDown = Newasp.Execute("SELECT id,downid,DownFileName,DownText FROM [NC_DownAddress] WHERE softid=" & CLng(softid))
If Not (rsDown.BOF And rsDown.EOF) Then
Do While Not rsDown.EOF
DownText = rsDown("DownText") & ""
If Len(DownText) = 0 Then DownText = "立即下载"
'---- 如果使用了下载服务器,就打开下载服务器数据表
If rsDown("downid") > 0 Then
sqlAddress = "SELECT downid,DownloadName,DownloadPath,IsDisp,DownPoint,UserGroup FROM NC_DownServer WHERE ChannelID=" & ChannelID & " And depth=1 And rootid =" & rsDown("downid") & " And isLock=0 ORDER BY orders ASC"
Set rsAddress = Newasp.Execute(sqlAddress)
If rsAddress.EOF And rsAddress.BOF Then
DownloadPath = ""
DownloadName = ""
Else
Do While Not rsAddress.EOF
DownAddress = DownAddress & Newasp.HtmlSetting(3)
'---- 是否直接显示软件直接的下载地址
'----将所有的下载服务器地址都连成一个数组
If rsAddress("IsDisp") = 0 Then
DownloadPath = "download.asp?softid=" & softid & "&downid=" & rsAddress("downid") & "&id=" & rsDown(0)
Else
DownloadPath = rsAddress("DownloadPath") & rsDown(2)
End If
If rsAddress("UserGroup") > 0 Then
DownloadName = Replace(rsAddress("DownLoadName"), "{$DownPoint}", rsAddress("DownPoint"))
Else
DownloadName = Replace(rsAddress("DownLoadName"), "{$DownPoint}", 0)
End If
DownAddress = Replace(DownAddress, "{$DownLoadUrl}", DownloadPath)
DownAddress = Replace(DownAddress, "{$DownLoadName}", DownloadName)
rsAddress.MoveNext
Loop
End If
Set rsAddress = Nothing
Else
DownAddress = DownAddress & Newasp.HtmlSetting(3)
If showdown > 0 Then
DownloadPath = Trim(rsDown("DownFileName") & "")
Else
DownloadPath = "download.asp?softid=" & softid & "&downid=0&id=" & rsDown(0)
End If
DownAddress = Replace(DownAddress, "{$DownLoadUrl}", DownloadPath)
DownAddress = Replace(DownAddress, "{$DownLoadName}", DownText)
End If
rsDown.MoveNext
Loop
End If
Set rsDown = Nothing
DownAddress = Replace(DownAddress, "{$SoftName}", SoftName)
DownAddress = Replace(DownAddress, "{$ChannelRootDir}", ChannelRootDir)
DownAddress = Replace(DownAddress, "{$InstallDir}", Newasp.InstallDir)
ShowDownAddress = DownAddress

Else

End If
End Function
CloseConn


2006-11-20 19:02
yms123
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
收藏
得分:0 

应该是错误发生时ErrMsg就不为空了吧?
那就可以写
If ErrMsg="" Then

2006-11-20 20:44
tang688
Rank: 5Rank: 5
等 级:贵宾
威 望:16
帖 子:1219
专家分:35
注 册:2004-12-25
收藏
得分:0 
哈哈,字符串一般是不等于或等于
If ErrMsg<>"" Then
If ErrMsg="" Then

2006-11-20 21:47
快速回复:[求助] if问题 请各位家人看看?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.031077 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved