Microsoft VBScript 运行时错误 错误 '800a0009'
下标越界: '[number: 1]'
D:\WEB20090405135\NINGJING\WEB\USER\../KS_Cls/Kesion.CommonCls.asp,行 3766
以上是错误提示。代码如下
- '分页SQL语句生成代码
- Function GetPageSQL(tblName,fldName,PageSize,PageIndex,OrderType,strWhere,fieldIds)
- Dim strTemp,strSQL,strOrder
-
- '根据排序方式生成相关代码
- if OrderType=0 then
- strTemp=">(select max([" & fldName & "])"
- strOrder=" order by [" & fldName & "] asc"
- else
- strTemp="<(select min([" & fldName & "])"
- strOrder=" order by [" & fldName & "] desc"
- end if
-
- '若是第1页则无须复杂的语句
- if PageIndex=1 then【这个是第3766行】
- strTemp=""
- if strWhere<>"" then strTemp = " where " + strWhere
- strSQL = "select top " & PageSize & " " & fieldIds & " from [" & tblName & "]" & strTemp & strOrder
- else '若不是第1页,构造SQL语句
- strSQL="select top " & PageSize & " " & fieldIds & " from [" & tblName & "] where [" & fldName & "]" & strTemp & _
- " from (select top " & (PageIndex-1)*PageSize & " [" & fldName & "] from [" & tblName & "]"
- if strWhere<>"" then
- strSQL=strSQL & " where " & strWhere
- end if
- strSQL=strSQL & strOrder & ") as tblTemp)"
- if strWhere<>"" then
- strSQL=strSQL & " And " & strWhere
- end if
- strSQL=strSQL & strOrder
- end if
- GetPageSQL=strSQL
- End Function
- '======================================================================================
- End Class
- %>