Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Databases
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 2nd, 2008, 08:38 AM
Registered User
 
Join Date: Apr 2008
Location: dar es salaam, , Tanzania.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to zedekiah
Default Cannot update. Database or object is read-only.

please some one enlighten me about this issue when i'm trying to add
new data to the database i got the above arror msg

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



AND THIS IS MY CODES
AND THIS IS THE CONNECTION
<%
  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=D:\Inetpub\wwwroot\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

/////////////////////////////////////XXXXXX//////////////////////////
<%
  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.MoveLast
  intIDForNewRecord = objRS("MovieID") + 1

  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>



Reply With Quote
  #2 (permalink)  
Old May 2nd, 2008, 09:30 AM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

This is usually a permissions issue:

http://imar.spaanjaars.com/QuickDocId.aspx?quickdoc=263

Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004
Want to be my colleague? Then check out this post.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Database or object is read-only ryanb Access ASP 25 January 17th, 2014 06:36 PM
Update Fails - Database is Read-Only pete robinson Classic ASP Basics 3 December 19th, 2007 02:40 PM
Read and update/increment XML doc from aspx Hughesie78 XML 7 December 13th, 2007 06:18 AM
How to read and update .INI files using Pure C ?? Poonam C++ Programming 1 March 24th, 2005 01:22 AM
Read only Database error larry101 Classic ASP Databases 4 September 11th, 2004 08:41 AM



All times are GMT -4. The time now is 11:54 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.