 |
| 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 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
|
|
|
|

August 21st, 2003, 09:29 AM
|
|
Authorized User
|
|
Join Date: Aug 2003
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Help regarding Addnew
Sir,
I am studying the Book Beginning ASP 3.0 and am new to asp.While working on the code examples of chapter 12 through 14 i faced a new problem. The datbase examples work fine when i run them on win 2000. But when i switch to win XP server and try to use: <recordset>.addnew
i receive the error that "couldnot update record. Databse or object is readonly".Even i cannot update a record. I have checked the mdb file to of access 2000 and is not read only. Although i can fetch data to be viewed on the borwser. PLz help.
__________________
------------------
Kaustav
|
|

August 21st, 2003, 11:16 AM
|
|
Authorized User
|
|
Join Date: Aug 2003
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
my guess is that it is the database's property. Because sometimes when you convert a database it is automatically set as read only, and so you have to change the property. Just try to play around with it and change the property to not just read only... =p
|
|

August 21st, 2003, 11:19 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 141
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Make sure your properties are not readonly like kyootepuffy said and while your at it make sure that you (as a website suer) have security provledges on the database file. I have had the same problem as I recall in the past when it dealt with security.
Chris
|
|

August 21st, 2003, 11:06 PM
|
|
Authorized User
|
|
Join Date: Aug 2003
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
kilika & kyootepuffy
I have checked with the property of the mdb file. It is not set to read only. Also. To see if ADO has some problem i worked with three versions of the file. I hav worked with the files office 97, office 2000 and office 2002 versions. But all gives the same error.
"Error Type:
Microsoft JET Database Engine (0x80040E09)
Cannot update. Database or object is read-only.
/addnew.asp, line 17"
in my code line 17 is "rs.addnew " where rs is the recordset object
|
|

August 22nd, 2003, 03:14 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Have you checked whether the user under which your asp page runs has rights to change the file, not just read rights?
Since you are a beginner, you may not know that asp pages usually run under a special "anonymous" user called IUSR_machineName. To check permissions, right-click the folder where your database is and choose Properties then the Security tab. If IUSR_machineName is not in the list of users then Add it. Then give that user change permissions (Full Control) and re-run your asp page.
hth
Phil
|
|

August 22nd, 2003, 11:05 PM
|
|
Authorized User
|
|
Join Date: Aug 2003
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Sir,
I have NTFS format on my server on WinXp. I think it is creating problem to add new record to a recordset. CAn you give me the steps how can i overcome this problem
------------------
Kaustav
|
|

August 22nd, 2003, 11:09 PM
|
|
Authorized User
|
|
Join Date: Aug 2003
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Sir, thanx for ur help.
But an you be more specific. I am having an NTFS formatting on my win XP server. CAn you specifically give me th details of how to o it.
Quote:
quote:Originally posted by pgtips
Have you checked whether the user under which your asp page runs has rights to change the file, not just read rights?
Since you are a beginner, you may not know that asp pages usually run under a special "anonymous" user called IUSR_machineName. To check permissions, right-click the folder where your database is and choose Properties then the Security tab. If IUSR_machineName is not in the list of users then Add it. Then give that user change permissions (Full Control) and re-run your asp page.
hth
Phil
|
------------------
Kaustav
|
|

August 26th, 2003, 03:35 PM
|
|
Friend of Wrox
|
|
Join Date: Jul 2003
Posts: 599
Thanks: 6
Thanked 3 Times in 3 Posts
|
|
Kaustav,
I had nothing but problems when using the AddNew function. I never found out what it was. Basically, it didn't work for me.
You don't have to use that.
You can simply use a SQL "INSERT" statement. Open a connection and execute a SQL statement. It works great. If anyone knows any advantages for using AddNew, please let me know.
Example:
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open strConnect
strSQLStatement = "Insert into Test (Name, Address) Values '" & strName & "', '" & strAddress & "');"
oConn.Execute strSQLStatement
Then you just have to make sure you close your connection. All is well.
|
|

January 10th, 2010, 06:33 PM
|
|
Registered User
|
|
Join Date: Jan 2010
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi,
I use this INSERT code also, but I have 70+ fiels and values, and VBE gives error that too many lines or too much code...
Is there a workaround?
|
|
 |