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
烦死了哦,麻烦各位帮看一下
谢谢