Wrox Programmer Forums
|
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP 3.0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 30th, 2004, 05:24 AM
Registered User
 
Join Date: Dec 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Ch 14 AdNew.asp example - Acess permission problem

I think I am having access permission problems running under Windows XP SP2.

The code is a s follows:
<%
  Option Explicit
  Dim strConnect
%>

<!-- METADATA TYPE="typelib"
              FILE="C:\Program Files\Common Files\System\ado\msado15.dll" -->
<HTML>
<HEAD>
<TITLE>Adding a New Record</TITLE>
</HEAD>
<BODY>
<%
  Dim objRS, intIDForNewRecord
  Set objRS = Server.CreateObject ("ADODB.Recordset")
  objRS.Open "Movies", strConnect, adOpenStatic, adLockOptimistic, adCmdTable

  objRs.MoveFirst
  intIDForNewRecord = objRS("MovieID") + 1
 Response.Write "strConnect: " & strConnect


  objRS.AddNew ' add a new record
  objRS("MovieID") = intIDForNewRecord
  objRS("Title") = "Psycho"
  objRS.Update
  objRS.Close

  objRS.Open "SELECT * FROM Movies WHERE MovieID=" & intIDForNewRecord, _
                   strConnect, adOpenForwardOnly, adLockReadOnly, adCmdText
  If objRS.EOF Then
    Response.Write "New record not found - something went wrong"
  Else
    Response.Write "You've successfully added a new record:<BR> " & _
                   "Movie title = '" & objRS("Title") & "'<BR>" & _
                   "MovieID = " & objRS("MovieID")
  End If

  objRS.Close ' now close and clean up
  Set objRS = Nothing
%>

</BODY>
</HTML>

The error message is:

Error Type:
Microsoft JET Database Engine (0x80040E09)
Cannot update. Database or object is read-only.
/BegASPFiles/AddNew.asp, line 23

So far as I can ascertain I have set execute, script and and write permissions to the tree to the data store.

I have similar problems with my own code.


Can you please advise?


 
Old November 1st, 2005, 05:38 AM
JLo JLo is offline
Registered User
 
Join Date: Oct 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I'm having the same problem. Cannot append or update the database tables.

Chapter 14 p595 file AddNew.asp

Error Type:
Microsoft JET Database Engine (0x80040E09)
Cannot update. Database or object is read-only.
/BegASPFiles/AddNew.asp, line 23

Has anyone had this problem and solved it?

Thanks in advance

Aaagh F***ing Computer!
 
Old November 22nd, 2005, 04:30 PM
Registered User
 
Join Date: May 2005
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

What is your code in DataStore.asp
mine is like this when I use access.

<%
  Dim strDatabaseType

  'Choose one of the following two lines, and comment out the other
  strDatabaseType = "Access"
  'strDatabaseType = "MSDE"

  'Now we use this selection to specify the connection string
  If strDatabaseType = "Access" Then
    strConnect = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
                 "Data Source=C:\datastores\Movie2000.mdb;" & _
                 "Persist Security Info=False"
  Else
    strConnect = "Provider=SQLOLEDB;Persist Security Info=False;" & _
                 "User ID=sa;Initial Catalog=Movie;" & _
                 "Initial File Name=C:\MSSQL7\Data\Movie2000.mdf"
  End If
%>



 
Old January 16th, 2006, 04:12 PM
Registered User
 
Join Date: Jan 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I am having this same problem. Has anyone fixed it?
Thanks
 
Old February 7th, 2006, 06:36 PM
Registered User
 
Join Date: Dec 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi.

This may be be of help.

1) Locate the folder the database is in and right click on the FOLDER and select 'Properties'.
2) Goto the 'Security' tab on the top.
3) Click on the 'Add' button.
4) Highlight the 'IUSR_xxxxx' name (xxxxx will be your computer name) Then, click the 'Add' button, then the 'Ok' button.
5) Under the 'Permissions' section, put a check in 'Modify' and 'Write'.
6) Make sure that 'Allow inheritable permissions from parent to propagate to this object' is also checked.
7) Click on the 'Apply' button and then the 'Ok' button.

Now go see if this has done the trick for you.

Regards,
JK






Similar Threads
Thread Thread Starter Forum Replies Last Post
Ch.14 Creating Windows Form User Controls problem SAIFI BOOK: Beginning Microsoft Visual Basic 2008 ISBN: 978-0-470-19134-7 1 September 29th, 2008 05:51 AM
ch.14 file errors caseyc BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 10 February 28th, 2006 03:59 PM
Ch. 13/14 creating own custom controls...problem.. Chimlim BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003 2 August 10th, 2005 04:21 AM
Ch. 14 Calendar Modification Astalder BOOK: Beginning ASP.NET 1.0 6 December 1st, 2004 06:23 PM
CH. 14 cart.php code problem shawnrberg BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 2 June 21st, 2004 05:44 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.