80040e14 mysql_【ASP】提示错误80040e14
是的,提示Cls_vbsPage.asp 行164 有問題,整個(gè)代碼如下:
Class Cls_vbsPage
Private oConn??? ??? '連接對(duì)象
Private iPagesize??? '每頁記錄數(shù)
Private sPageName??? '地址欄頁數(shù)參數(shù)名
Private sDbType
'數(shù)據(jù)庫類型,AC為access,MSSQL為SQL SERVER2000存儲(chǔ)過程版,MYSQL為mysql,PGSQL為PostGreSql
Private iRecType??? '記錄總數(shù)(>0為另外取值再賦予或者固定值,0執(zhí)行count設(shè)置存cookies,-1執(zhí)行count不設(shè)置cookies)
Private sJsUrl??? ??? 'Cls_jsPage.js的路徑
Private sField??? ??? '字段名
Private sTable??? ??? '表名
Private sCondition??? '條件,不需要where
Private sOrderBy??? '排序,不需要order by,需要asc或者desc
Private sPkey??? ??? '主鍵,必寫
Private iRecCount
'================================================================
' Class_Initialize 類的初始化
'================================================================
Private Sub Class_Initialize
iPageSize=10
sPageName="Page"
sDbType="AC"
iRecType=0
sJsUrl=""
sField=" * "
End Sub
'================================================================
' Conn 得到數(shù)據(jù)庫連接對(duì)象
'================================================================
Public Property Set Conn(ByRef Value)
Set oConn=Value
End Property
'================================================================
' PageSize 設(shè)置每一頁記錄條數(shù),默認(rèn)10記錄
'================================================================
Public Property Let PageSize(ByVal intPageSize)
iPageSize=CheckNum(intPageSize,0,0,iPageSize,0)
End Property
'================================================================
' PageName 地址欄頁數(shù)參數(shù)名
'================================================================
Public Property Let PageName(ByVal strPageName)
sPageName=IIf(Len(strPageName)<1,sPageName,strPageName)
End Property
'================================================================
' DbType 得到數(shù)據(jù)庫類型
'================================================================
Public Property Let DbType(ByVal strDbType)
sDbType=UCase(IIf(Len(strDbType)<1,sDbType,strDbType))
End Property
'================================================================
' RecType 取記錄總數(shù)(>0為賦值或者固定值,0執(zhí)行count設(shè)置存cookies,-1執(zhí)行count不設(shè)置cookies適用于搜索)
'================================================================
Public Property Let RecType(ByVal intRecType)
iRecType=CheckNum(intRecType,0,0,iRecType,0)
End Property
'================================================================
' JsUrl 取得Cls_jsPage.js的路徑
'================================================================
Public Property Let JsUrl(ByVal strJsUrl)
sJsUrl=strJsUrl
End Property
'================================================================
' Pkey 取得主鍵
'================================================================
Public Property Let Pkey(ByVal strPkey)
sPkey=strPkey
End Property
'================================================================
' Field 取得字段名
'================================================================
Public Property Let Field(ByVal strField)
sField=IIf(Len(strField)<1,sField,strField)
End Property
'================================================================
' Table 取得表名
'================================================================
Public Property Let Table(ByVal strTable)
sTable=strTable
End Property
'================================================================
' Condition 取得條件
'================================================================
Public Property Let Condition(ByVal strCondition)
s=strCondition
sCondition=IIf(Len(s)>2," WHERE "&s,"")
End Property
'================================================================
' OrderBy 取得排序
'================================================================
Public Property Let OrderBy(ByVal strOrderBy)
s=strOrderBy
sOrderBy=IIf(Len(s)>4," ORDER BY "&s,"")
End Property
'================================================================
' RecCount 修正記錄總數(shù)
'================================================================
Public Property Get RecCount()
If iRecType>0 Then
i=iRecType
Elseif iRecType=0 Then
i=CheckNum(Request.Cookies("ShowoPage")(sPageName),1,0,0,0)
s=Trim(Request.Cookies("ShowoPage")("sCond"))
IF i=0 OR sCondition<>s Then
i=oConn.Execute("SELECT COUNT("&sPkey&") FROM "&sTable&" "&sCondition,0,1)(0)
Response.Cookies("ShowoPage")(sPageName)=i
Response.Cookies("ShowoPage")("sCond")=sCondition
End If
Else
i=oConn.Execute("SELECT COUNT("&sPkey&") FROM "&sTable&" "&sCondition,0,1)(0)
End If
iRecCount=i
RecCount=i
End Property
'================================================================
' ResultSet 返回分頁后的記錄集
'================================================================
Public Property Get ResultSet()
s=Null
'記錄總數(shù)
i=iRecCount
'當(dāng)前頁
If i>0 Then
iPageCount=Abs(Int(-Abs(i/iPageSize)))'頁數(shù)
iPageCurr=CheckNum(Request.QueryString(sPageName),1,1,1,iPageCount)'當(dāng)前頁
Select Case sDbType
Case "MSSQL" 'sqlserver2000數(shù)據(jù)庫存儲(chǔ)過程版
Set Rs=server.CreateObject("Adodb.RecordSet")
Set Cm=Server.CreateObject("Adodb.Command")
Cm.CommandType=4
Cm.ActiveConnection=oConn
Cm.CommandText="sp_Util_Page"
Cm.parameters(1)=i
Cm.parameters(2)=iPageCurr
Cm.parameters(3)=iPageSize
Cm.parameters(4)=sPkey
Cm.parameters(5)=sField
Cm.parameters(6)=sTable
Cm.parameters(7)=Replace(sCondition," WHERE ","")
Cm.parameters(8)=Replace(sOrderBy," ORDER BY ","")
Rs.CursorLocation=3
Rs.LockType=1
Rs.Open Cm
Case "MYSQL" 'MYSQL數(shù)據(jù)庫
ResultSet_Sql="SELECT "&sField&" FROM "&sTable&" "&sCondition&" "&sOrderBy&" LIMIT "&(iPageCurr-1)*iPageSize&","&iPageSize
Set Rs=oConn.Execute(ResultSet_Sql)
Case Else '其他情況按最原始的方法處理(AC同理)
Set Rs = Server.CreateObject ("Adodb.RecordSet")
ResultSet_Sql="SELECT "&sField&" FROM "&sTable&" "&sCondition&" "&sOrderBy
Rs.Open ResultSet_Sql,oConn,1,1,&H0001
Rs.AbsolutePosition=(iPageCurr-1)*iPageSize+1
End Select
s=Rs.GetRows(iPageSize)
Rs.close
Set Rs=Nothing
End If
ResultSet=s
End Property
'================================================================
' Class_Terminate 類注銷
'================================================================
Private Sub Class_Terminate()
If IsObject(oConn) Then oConn.Close:Set oConn=Nothing
End Sub
'================================================================
' 輸入:檢查字符,是否有最小值,是否有最大值,最小值(默認(rèn)數(shù)字),最大值
'================================================================
Private Function CheckNum(ByVal strStr,ByVal blnMin,ByVal blnMax,ByVal intMin,ByVal intMax)
Dim i,s,iMi,iMa
s=Left(Trim(""&strStr),32):iMi=intMin:iMa=intMax
If IsNumeric(s) Then
i=CDbl(s)
i=IIf(blnMin=1 And i
i=IIf(blnMax=1 And i>iMa,iMa,i)
Else
i=iMi
End If
CheckNum=i
End Function
'================================================================
' 輸入:簡(jiǎn)化條件判斷
'================================================================
Private Function IIf(ByVal blnBool,ByVal strStr1,ByVal strStr2)
Dim s
If blnBool Then
s=strStr1
Else
s=strStr2
End If
IIf=s
End Function
'================================================================
' 上下頁部分
'================================================================
Public Sub ShowPage()%>
var s= new Cls_jsPage(,,3,"s");
s.setPageSE("=","");
s.setPageInput("");
s.setUrl("");
s.setPageFrist("首頁","首頁");
s.setPagePrev("上頁","上頁");
s.setPageNext("下頁","下頁");
s.setPageLast("尾頁","尾頁");
s.setPageText("[{$PageNum}]","第{$PageNum}頁");
s.setPageTextF(" {$PageTextF} "," {$PageTextF} ");
s.setPageSelect("{$PageNum}","第{$PageNum}頁");
s.setPageCss("","","");
s.setHtml("共{$RecCount}記錄 頁次{$Page}/{$PageCount} 每頁{$PageSize}條 {$PageFrist} {$PagePrev} {$PageText} {$PageNext} {$PageLast} {$PageInput} {$PageSelect}");
s.Write();
End Class%>
以上是asp分頁程序,改頁其他頁面引用一切正常,唯獨(dú)Plist.asp引用就出錯(cuò),以下為Plist.asp代碼
項(xiàng)目管理window.name = "win";
Dim itemname,rootid
rootid=trim(request("rootid"))
itemname=Trim(request("itemname"))
If itemname<>"" Then itemname=Replace(itemname,"'","")
if rootid="" then rootid=0
%>
| 所屬項(xiàng)目: Dim rs,sql sql = "select * from Sk_Product where rootid=0 order by sorder asc,id asc" Set rs = conn.execute(sql,0,1) If Not rs.eof Then While Not rs.eof response.write " If cint(rs(0))=cint(rootid) Then response.write "selected" End If response.write ">"&rs(1)&" "rs.movenext Wend End If rs.close Set rs=Nothing %> ?項(xiàng)目名稱:/>? |
| 項(xiàng)目名稱 | 報(bào)價(jià) | 說明 |
Dim ors,scon
scon = " 1=1 "
If itemname<>"" Then scon = scon & " and itemname like '%"&itemname&"%' "
if rootid<>0 then scon = scon & " and (id="&rootid&" or rootid="&rootid&") "
Set ors=new Cls_vbsPage??? '創(chuàng)建對(duì)象
Set ors.Conn=conn??? ??? '得到數(shù)據(jù)庫連接對(duì)象
With ors
.PageSize=10??? ??? '每頁記錄條數(shù)
.PageName="Page"??? 'cookies名稱
.DbType="AC"
.RecType=-1
.JsUrl="Script/"
.Pkey="id"
.Field="[id],[itemname],[price],[intro],[rootid]"
.Table="Sk_Product"
.Condition=scon
.OrderBy="IIF(rootid=0,id,rootid),rootid"
End With
iRecCount=ors.RecCount()'記錄總數(shù)
iRs=ors.ResultSet()??? ??? '返回ResultSet
If? iRecCount<1 Then
%>
沒有找到相關(guān)記錄Set iRs=nothing
else
For i=0 To Ubound(iRs,2)
%>
" onMouseOver="this.style.background='#EAF3FF'" onMouseOut="this.style.background='#FFF'"0 then response.write "οnclick=""selectitem("&iRs(0,i)&")"""%>>
0 then%>
0 then%>
元?Next
Set iRs=nothing
End If
conn.close
set conn=nothing
%>
/>
var _a = document.getElementsByTagName("a");
for(i=0;i<_a.length>
_a[i].target = "win";
}
function selectitem(id){
var _id = document.getElementsByName("id");
for(i=0;i<_id.length>
if(_id[i].value==id){
_id[i].checked = true;
}else{
_id[i].checked = false;
}
}
}
document.getElementById("select").οnclick=function(){
var n = 0;
var id = 0;
var _id = document.getElementsByName("id");
for(i=0;i<_id.length>
if(_id[i].checked){
id = _id[i].value;
n += 1;
}
}
if(n==0){
alert("請(qǐng)選擇一個(gè)項(xiàng)目");
return
}
var itemname = document.getElementById("itemname"+id).innerHTML;
itemname = itemname.replace(/]*>/g,''); //去除HTML tag
itemname = itemname.replace(/[ | ]*\n/g,'\n'); //去除行尾空白
itemname = itemname.replace(/\n[\s| | ]*\r/g,'\n'); //去除多余空行
var price = document.getElementById("price"+id).innerHTML.replace("元","");
window.returnValue = itemname+","+price;
window.close();
}
但出錯(cuò)的不是Plist.asp頁面,而是Cls_vbsPage.asp頁面,程序指向Cls_vbsPge.asp錯(cuò)誤,但這個(gè)頁面其他頁面引用就沒有問題,我懷疑是Plist.asp的問題,但找了好半天沒有找到原因所在,請(qǐng)高手幫忙看一下,在此表示感激不盡!
總結(jié)
以上是生活随笔為你收集整理的80040e14 mysql_【ASP】提示错误80040e14的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 查看mysql数据库历史_查看mysql
- 下一篇: python sqllite远程_Pyt