标题:Microsoft VBScript 运行时错误 '800a000d'
只看楼主
a309223515
Rank: 2
等 级:论坛游民
帖 子:29
专家分:10
注 册:2010-4-8
结帖率:77.78%
已结贴  问题点数:20 回复次数:4 
Microsoft VBScript 运行时错误 '800a000d'
这是类
DBHelper.asp
程序代码:
<%
Class DBHelper
    Private conn
    Private Sub Class_Initialize
        strConn="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("../../story/Database2.mdb")
        Set conn=Server.CreateObject("ADODB.Connection" )
        conn.Open(strConn)
    End Sub
    Private Sub Class_Terminate
        conn.Close()
        Set conn=nothing
    End Sub
    Public Function ExecuteQuery(strSql)
        Set rs=Server.CreateObject("ADODB.RecordSet")
        rs.Open strSql,conn,1,1
        Set ExecuteQuery=rs
    End Function
    Public Sub ExecuteNonQuery(strSql)
        conn.Execute(strSql)
    End Sub
End Class
Set DB=new DBHelper
%>
这是业务层BLL.ASP
程序代码:
<!--#include file="DAL.asp"-->
<%
Class bookBLL
    Public Function InsertBook(objBookInfo)
            bookDao.InsertBook(objBookInfo)
            InsertBook="产品添加成功!"
    End Function
   
    Public Function Deletebook(intbookId)
        If IsNumeric(intbookId) Then
            bookDao.Deletebook(intbookId)
            Deletebook="产品删除成功!"
        End If
    End Function
   
    Public Function Updatebook(objbookInfo)
            bookDao.Updatebook(objbookInfo)
            Updatebook="产品修改成功!"
    End Function
   
    Public Function GetAllbook()
        Set GetAllbook=bookDao.GetAllbook()
    End Function
   
    Public Function GetbookById(intbookId)
        Set GetbookById=bookDao.GetbookById(intbookId)
    End Function
   
End Class
Set bookManager=new bookBLL
%>


这是数据访问层DAL.asp
程序代码:
<!--#include file="Model.asp"-->
<!--#include file="DBHelper.asp"-->
<%
Class bookDAL
'///////
'添加
    Public Sub InsertBook(objBookInfo)
        strInsertSql="insert into [book] (book_name,book_cover,book_price,book_catalogue,pcls) values ('"&objBookInfo.book_name &"','"& objBookInfo.book_cover &"',"&objBookInfo.book_price&",'"&objBookInfo.book_catalogue&"','"&objBookInfo.pcls&"')"
        DB.ExecuteNonQuery(strInsertSql)
    End Sub
'///////

'//////   
'删除
    Public Sub Deletebook(intbookId)
        strDeleteSql="delete from [book] where bookId="& intbookId
        DB.ExecuteNonQuery(strDeleteSql)
    End Sub
'//////

'/////   
'修改
    Public Sub Updatebook(objbookInfo)
        strUpdateSql="update [book] set book_name='"& objBookInfo.book_name&"',book_cover='"&objBookInfo.book_cover &"',book_price='"&objBookInfo.book_price &",book_catalogue='"&objBookInfo.book_catalogue &"',pcls='"&objBookInfo.pcls &"' where Bookid="& objBookInfo.Bookid
        DB.ExecuteNonQuery(strUpdateSql)
    End Sub
'/////
   
    Public Function GetAllbook()
        strSelectSql="select * from [book]"
        Set rs=DB.ExecuteQuery(strSelectSql)
        Set dic=Server.CreateObject("Scripting.Dictionary")
        While not rs.eof
            Set book=Createbook(rs)
            dic.Add book.bookId,book
            rs.MoveNext
        wend
        rs.Close
        Set rs=nothing
        Set GetAllbook=dic
    End Function
   
    Public Function GetbookById(intbookid)
        strSelectSql="select * from [book] where bookid="&intbookid
        Set rs=DB.ExecuteQuery(strSelectSql)
        Set book=GetbookById(rs)
        rs.Close
        Set rs=nothing
        Set GetbookById=book
    End Function
   
    Private Function Createbook(rs)
        Set book=new bookInfo
        book.Bookid=rs("bookid")
        book.book_name=rs("book_name")
        book.book_cover=rs("book_cover")
        book.book_price=rs("book_price")
        book.book_catalogue=rs("book_catalogue")
        book.pcls=rs("pcls")
        Set Createbook=book
    End Function
   
End Class

Set bookDao=new bookDAL
%>


这是一个实体类Model.asp
程序代码:
<%
Class bookInfo
    Private mintId
    Public Property Let Bookid(intbookId)
        mintId = intbookId
    End Property
    
    Public Property Get bookid()
        bookid=mintId
    End Property

   
    Private mstrbook_name
    Public Property Let book_name(strbook_name)
        mstrbook_name = strbook_name
    End Property

    Public Property Get book_name()
        book_name = mstrbook_name
    End Property

   
    Private mintbook_cover
    Public Property Let book_cover(intbook_cover)
        mintbook_cover=intbook_cover
    End Property
   
    Public Property Get book_cover()
        book_cover = mintbook_cover
    End Property
   
   
    Private micbook_price
    Public Property Let book_price(intbook_price)
        micbook_price=intbook_price
    End Property
   
    Public Property Get book_price()
        book_price = micbook_price
    End Property
   
    Private maxbook_catalogue
    Public Property Let book_catalogue(intbook_catalogue)
        maxbook_catalogue=intbook_catalogue
    End Property
   
    Public Property Get book_catalogue()
        book_catalogue = maxbook_catalogue
    End Property
   
   
    Private mipcls
    Public Property Let pcls(intpcls)
        mipcls=intpcls
    End Property
   
    Public Property Get pcls()
        pcls = mipcls
    End Property       
End Class
%>
这个是修改保存页面DoDeleteUser.asp
程序代码:
<!--#include file="BLL.asp"-->
<%
Book_name=Request.Form("Book_name")
book_cover=Request.Form("book_cover")
book_price=Request.Form("book_price")
book_catalogue=Request.Form("book_catalogue")
pcls=Request.Form("pcls")
Set book=New bookInfo
Book.Book_name=Book_name
Book.book_cover=book_cover
Book.book_price=book_price
Book.book_catalogue=book_catalogue
Book.pcls=pcls
Response.Write(bookManager.Insertbook(book))
response.End()
%>
修改了好长时间都显示
Microsoft VBScript 运行时错误 '800a000d'

类型不匹配

\Human\book_city\DAL.asp, line 44

烦死了哦,麻烦各位帮看一下
谢谢


搜索更多相关主题的帖子: Microsoft 
2011-03-23 14:36
yms123
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
得分:14 
strSelectSql="select * from [book] where bookid="&intbookid
44行指的是这句话有错误,查看调用GetbookById这个方法的代码怎么写的
2011-03-23 14:58
a309223515
Rank: 2
等 级:论坛游民
帖 子:29
专家分:10
注 册:2010-4-8
得分:0 
回复 2楼 yms123
我就是这样写的
    Public Function GetbookById(intbookId)
        Set GetbookById=bookDao.GetbookById(intbookId)
    End Function
文件在bll.asp 里面
不知道是哪里错了,现在你这一说我感觉好像用反了。


2011-03-23 15:50
yms123
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
得分:0 
    Public Function GetbookById(intbookId)
        Set GetbookById=bookDao.GetbookById(intbookId)
    End Function
这里不是最终调用代码
2011-03-23 16:55
a309223515
Rank: 2
等 级:论坛游民
帖 子:29
专家分:10
注 册:2010-4-8
得分:0 
都调试过了,但还是那个错
Microsoft VBScript 运行时错误 '800a000d'

类型不匹配

\Human\book_city\DAL.asp, line 44行
2011-03-23 17:53



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-334506-1-1.html




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

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