尝试附上rs.addnew是一个try catch块来获取更好的错误消息。对于Web来说,Sql server比访问要好得多。 MSDE 是sql server的免费版本。 尝试 rs.addnew catch ex as exception Response.write(ex.tostring) http://www.microsoft.com/downloads/d...displaylang=en Ken ------- -------------- 马克B < MB ******* @ Delete-All-X-XorbisofXXt.com>在消息中写道新闻:eV ************* @ TK2MSFTNGP09.phx.gbl ... 我们的虚拟主机( www.usbusinessweb.net )在安装ms-security补丁安装过程中发生计划的硬启动后,W2K IIS5服务器崩溃。他们无法使服务器再次运行,因此他们转移了我们的网站 www.orbisoft.com to a new W2003 IIS6 server they set up. That was a week ago. Since that transfer, all of our ASPX pages that use Access2000 databases have stopped working. Our main one is our "buy" page at http://www.orbisoft.com/products/tas...t-version.aspx which means potential customers can’’t purchase there. I have shown the error below which essentially says "Cannot update. Database or object is read-only." After numerous assurances from our webhost that they have set anonymous user write access for both the /fpdb folder and the individual databases we still get the same error. They say it is our fault in that there is something in our code that isn’’t right. They say the have another user where their aspx pages with MSAccess are working. I said "but all aspx pages were working fine on IIS5...." "Line 211: rs.addnew" below is the where the error is highlighted. The actual relevant code snip-it is as follows with the runtime error listed below that. You also are welcome to test the page at http://www.orbisoft.com/products/tas...t-version.aspx with a junk order too - I won’’t hold you to it: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> <%@Page aspcompat=true Language = VB Debug="true"%> <%@Import Namespace="aspNetEmail"%> <%@Import Namespace="System.Data"%> <%@Import Namespace="System.Data.OleDb"%> <%@Import Namespace="aspNetMX"%> <%@Import Namespace="System.Globalization"%> <script language="VB" runat="server"> Dim strFirstName as String Dim strLastName as String Dim strExisting as String Dim strNumberUsers as String Dim strCompany as String Dim strTitle as String Dim strEmailAddress as String Dim strAddress as String Dim strCity as String Dim strState as String Dim strZip as String Dim strCountry as String Dim strTelephone as String Dim strIndustry as String Dim strOtherIndustry as String Dim strWHSpecific as String Dim strComment as String Dim strPromoCode as String Dim strProductName as String Dim dblQuantity as Double Dim dblProductPrice as Double Dim dblExtension as Double Dim dblPromotionalCodeSavings as Double Dim dblTotalUSD as Double Public Function strProper(strRaw as String) As String Dim currentTextInfo currentTextInfo = CultureInfo.CurrentCulture.TextInfo strProper = currentTextIn fo.ToTitleCase(strRaw) End Function Function bolStoreEntries() ’’Store entries temporarily for populating after validation fail ’’************************************************* ************* strFirstName = Request("FirstName") strLastName = Request("LastName") strExisting = "No" strNumberUsers = Request("NumberUsers") strCompany = Request("Company") strTitle = Request("Title") strEmailAddress = Request("EmailAddress") strAddress = Request("Address") strCity = Request("City") strState = Request("State") strZip = Request("Zip") strCountry = Request("Country") strTelephone = Request("Telephone") strIndustry = Request("Industry") strOtherIndustry = Request("OtherIndustry") strWHSpecific = Request("Wher eHeard") strComment = Request("Comment") End Function </script> <% Dim bolErr as Boolean bolStoreEntries fCalculatePrices If Request("OrderNow") <> "" Then ’’Save to database ’’**************** Dim strHTML as String Dim strlf as String Dim strS1 as String Dim strS2 as String Dim strS3 as String Dim strErr as String Dim bSuccess as Boolean Dim sPath as String Dim conn Dim rs Dim lngInvoiceNumber as Long Dim lngInvoiceReference as Long sPath = "D:\inetpub\www\orbisoft\fpdb\dbOnlineOrders.m db" conn = Server.CreateObject("ADODB.Connection") conn.open ("Provider=Microsoft.Jet.OLEDB.4.0;" & "Persist Security Info=TRUE;" & "Data Source=" & sPath, "Admin", "") rs = server.createobject("adodb.recordset") rs.open ("tblOrders", conn, 2, 2) rs.addnew if Request("FirstName") <> "" then rs("FirstName")= strProper(Request("FirstName")) if Request("LastName") <> "" then rs("LastName")= strProper(Request("LastName")) etc... And here’’s the error it now gives (falling over on the 211 rs.addnew line): Server Error in ’’/’’ Application. Cannot update. Database or object is read-only. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Runtime.InteropServices.COMException: Cannot update. Database or object is read-only. Source Error: Line 209: rs.open ("tblOrders", conn, 2, 2) Line 210: Line 211: rs.addnew Line 212: Line 213: if Request("FirstName") <> "" then rs("FirstName")= strProper(Request("FirstName")) Source File: D:\Inetpub\www\orbisoft\products\taskmanager\2005\ purchase\order-details.asp x Line: 211 Stack Trace: [COMException (0x80040e09): Cannot update. Database or object is read-only.] Microsoft.VisualBasic.CompilerServices.LateBinding .InternalLateCall(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack, Boolean IgnoreReturn) +798 Microsoft.VisualBasic.CompilerServices.LateBinding .LateCall(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack) +23 ASP.order_details_aspx.__Render__control1(HtmlText Writer __output, Control parameterContainer) in D:\Inetpub\www\orbisoft\products\taskmanager\2005\ purchase\order-details.asp x:211 System.Web.UI.Control.RenderChildren(HtmlTextWrite r writer) +27 System.Web.UI.Control.Render(HtmlTextWriter writer) +7 System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +243 System.Web.UI.Page.ProcessRequestMain() +1926 Version Information: Microsoft .NET F ramework Version:1.1.4322.2300; ASP.NET Version:1.1.4322.2300 Any ideas very much appreciated .... Mark Hi, Try enclosing rs.addnew is a try catch block to get abetter error message. Sql server is much better for the web than access. MSDEis a free version of sql server. Try rs.addnew catch ex as exception Response.write(ex.tostring) end try http://www.microsoft.com/downloads/d...displaylang=en Ken --------------------- "Mark B" <mb*******@Delete-All-X-XorbisofXXt.com> wrote in message news:eV*************@TK2MSFTNGP09.phx.gbl... Our webhost (www.usbusinessweb.net) had a W2K IIS5 server crash after a scheduled hard-boot occurred during a ms-security patch install overnight. They couldn''t get the server working again so they transferred our site www.orbisoft.com to a new W2003 IIS6 server they set up. That was a week ago. Since that transfer, all of our ASPX pages that use Access2000 databases have stopped working. Our main one is our "buy" page at http://www.orbisoft.com/products/tas...t-version.aspx which means potential customers can''t purchase there. I have shown the error below which essentially says "Cannot update.Database or object is read-only." After numerous assurances from our webhost that they have set anonymoususer write access for both the /fpdb folder and the individual databases westill get the same error. They say it is our fault in that there is something in our code that isn''t right. They say the have another user where their aspx pages with MSAccess are working. I said "but all aspx pages were working fine on IIS5...." "Line 211: rs.addnew" below is the where the error is highlighted. The actual relevant code snip-it is as follows with the runtime errorlisted below that. You also are welcome to test the page at http://www.orbisoft.com/products/tas...t-version.aspx with a junk order too - I won''t hold you to it: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> <%@Page aspcompat=true Language = VB Debug="true"%> <%@Import Namespace="aspNetEmail"%> <%@Import Namespace="System.Data"%> <%@Import Namespace="System.Data.OleDb"%> <%@Import Namespace="aspNetMX"%> <%@Import Namespace="System.Globalization"%> <script language="VB" runat="server"> Dim strFirstName as String Dim strLastName as String Dim strExisting as String Dim strNumberUsers as String Dim strCompany as String Dim strTitle as String Dim strEmailAddress as String Dim strAddress as String Dim strCity as String Dim strState as String Dim strZip as String Dim strCountry as String Dim strTelephone as String Dim strIndustry as String Dim strOtherIndustry as String Dim strWHSpecific as String Dim strComment as String Dim strPromoCode as String Dim strProductName as String Dim dblQuantity as Double Dim dblProductPrice as Double Dim dblExtension as Double Dim dblPromotionalCodeSavings as Double Dim dblTotalUSD as Double Public Function strProper(strRaw as String) As String Dim currentTextInfo currentTextInfo = CultureInfo.CurrentCulture.TextInfo strProper = currentTextInfo.ToTitleCase(strRaw) End Function Function bolStoreEntries() ''Store entries temporarily for populating after validation fail ''************************************************* ************* strFirstName = Request("FirstName") strLastName = Request("LastName") strExisting = "No" strNumberUsers = Request("NumberUsers") strCompany = Request("Company") strTitle = Request("Title") strEmailAddress = Request("EmailAddress") strAddress = Request("Address") strCity = Request("City") strState = Request("State") strZip = Request("Zip") strCountry = Request("Country") strTelephone = Request("Telephone") strIndustry = Request("Industry") strOtherIndustry = Request("OtherIndustry") strWHSpecific = Request("WhereHeard") strComment = Request("Comment") End Function </script> <% Dim bolErr as Boolean bolStoreEntries fCalculatePrices If Request("OrderNow") <> "" Then ''Save to database ''**************** Dim strHTML as String Dim strlf as String Dim strS1 as String Dim strS2 as String Dim strS3 as String Dim strErr as String Dim bSuccess as Boolean Dim sPath as String Dim conn Dim rs Dim lngInvoiceNumber as Long Dim lngInvoiceReference as Long sPath = "D:\inetpub\www\orbisoft\fpdb\dbOnlineOrders.m db" conn = Server.CreateObject("ADODB.Connection") conn.open ("Provider=Microsoft.Jet.OLEDB.4.0;" & "Persist Security Info=TRUE;" & "Data Source=" & sPath, "Admin", "") rs = server.createobject("adodb.recordset") rs.open ("tblOrders", conn, 2, 2) rs.addnew if Request("FirstName") <> "" then rs("FirstName")= strProper(Request("FirstName")) if Request("LastName") <> "" then rs("LastName")= strProper(Request("LastName")) etc... And here''s the error it now gives (falling over on the 211 rs.addnewline): Server Error in ''/'' Application. Cannot update. Database or object is read-only. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Runtime.InteropServices.COMException: Cannot update. Database or object is read-only. Source Error: Line 209: rs.open ("tblOrders", conn, 2, 2) Line 210: Line 211: rs.addnew Line 212: Line 213: if Request("FirstName") <> "" then rs("FirstName")= strProper(Request("FirstName")) Source File:D:\Inetpub\www\orbisoft\products\taskmanager\2005\ purchase\order-details.asp x Line: 211 Stack Trace: [COMException (0x80040e09): Cannot update. Database or object is read-only.] Microsoft.VisualBasic.CompilerServices.LateBinding .InternalLateCall(Object o, Type objType, String name, Object[] args, String[] paramnames,Boolean[] CopyBack, Boolean IgnoreReturn) +798 Microsoft.VisualBasic.CompilerServices.LateBinding .LateCall(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack) +23 ASP.order_details_aspx.__Render__control1(HtmlText Writer __output, Control parameterContainer) inD:\Inetpub\www\orbisoft\products\taskmanager\2005\ purchase\order-details.asp x:211 System.Web.UI.Control.RenderChildren(HtmlTextWrite r writer) +27 System.Web.UI.Control.Render(HtmlTextWriter writer) +7 System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +243 System.Web.UI.Page.ProcessRequestMain() +1926 Version Information: Microsoft .NET Framework Version:1.1.4322.2300;ASP.NET Version:1.1.4322.2300 Any ideas very much appreciated .... Mark 这篇关于IIS5&gt;带有MSAccess dbs的IIS6 Aspx页面不再有效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
11-01 01:35