ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 17th, 2003, 10:35 AM
pank pank is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 9 pank User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Can't update MS Access DB

Hi all, I'm new to asp.

I have this code:
Code:
<%@ Language=VBScript %>
<%
   	dim conn
   	dim rs
	
	set conn = server.CreateObject("ADODB.connection")
	set rs = server.CreateObject("ADODB.recordset")	
		
	conn.Open "DRIVER=Microsoft Access Driver (*.mdb);" & _
	"DBQ=" & server.mappath("mydatabase.mdb")&";"
	
	rs.Open "Customer_Records",conn,3,3
	rs.AddNew
	rs("Fname")= "Yvonne"
	rs.Update

	rs.Close 
	conn.Close
	set rs = nothing
	set conn = nothing      	
%>


And it keeps giving this error:
Quote:
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver] Cannot update. Database or object is read-only
test.asp, line 17


Why will this happened?
Thks!

Reply With Quote
  #2  
Old November 17th, 2003, 11:39 AM
pank pank is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 9 pank User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Am i right to say that i don't have permission to update my database??

If so... i'm using Win XP Pro...how can i grant permission? Thanks!

Reply With Quote
  #3  
Old November 17th, 2003, 12:51 PM
DarrenMBrink DarrenMBrink is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Ohio
Posts: 30 DarrenMBrink User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 41 m 6 sec
Reputation Power: 5
Send a message via AIM to DarrenMBrink
If your testing locally on your machine make sure the folder your database is in has read and write capabilities under you login name. If its a problem your having when you are testing online then you would need to contact your hosting provider and let them know you do not have the correct permission and have them set it up for you.

Reply With Quote
  #4  
Old November 17th, 2003, 02:45 PM
INF INF is offline
Standards User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 146 INF User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 m 4 sec
Reputation Power: 6
I believe you'll need to set the folder to have read and write permissions for the IIS user (IUSR_YOURMACHINE). Just right click on the folder your db is in and click properties. Then go to the security, or permissions tab (Not sure in XP Pro) and add write to the IUSR

Reply With Quote
  #5  
Old November 17th, 2003, 06:40 PM
Doug G Doug G is offline
Grumpier Old Moderator
Dev Shed God 12th Plane (10500 - 10999 posts)
 
Join Date: Jun 2003
Posts: 10,957 Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 15 h 35 m 19 sec
Reputation Power: 802

Reply With Quote
  #6  
Old November 17th, 2003, 10:09 PM
pank pank is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 9 pank User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi thks all for your kind info.. but i still can't solve this prob...

I'm testing locally on my machine.
The folder my database is in has read and write capabilities under my login name.

What's happening?

Reply With Quote
  #7  
Old November 17th, 2003, 11:35 PM
INF INF is offline
Standards User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 146 INF User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 m 4 sec
Reputation Power: 6
ASP scripts run under the IUSR_ account. Verify that account has write access to the folder.
You could also check to be sure the actual database has write permissions set properly.

Reply With Quote
  #8  
Old November 18th, 2003, 12:57 AM
pank pank is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 9 pank User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Quote:
Originally posted by INF
ASP scripts run under the IUSR_ account. Verify that account has write access to the folder.
You could also check to be sure the actual database has write permissions set properly.



Sorry for the trouble.... but how can i do the above?

Reply With Quote
  #9  
Old November 18th, 2003, 03:26 AM
INF INF is offline
Standards User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 146 INF User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 m 4 sec
Reputation Power: 6

Reply With Quote
  #10  
Old November 18th, 2003, 09:26 AM
pank pank is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 9 pank User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thks INF. The reference are very useful.

I had verified that my IUSR_ account did have read and write permission. The database itself also have write permission set. But the same prob still occur.

Is there any other thing that i have miss??

Reply With Quote
  #11  
Old November 18th, 2003, 09:50 AM
m3ckon m3ckon is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Sheffield UK
Posts: 69 m3ckon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 m 57 sec
Reputation Power: 5
I've read your post and I'm not sure if this will fix it or not, but it may be worth a go.

With Access 97 on the web and ASp by default it logs into tables as administrator; this is permisions withint acces, not user accounts for the machine or domain. I'm not sure if it is the same for later versions of access, although I presume it is, so I'd check that admin has read, write and update (if necessary) permissions for the tables you are trying to query using ASP.

M3ckon

Reply With Quote
  #12  
Old November 18th, 2003, 10:02 AM
pank pank is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 9 pank User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thks M3ckon, in fact my admin acc already have all kinds of permissions. I don't think this is the prob. thks anyway.

Reply With Quote
  #13  
Old November 18th, 2003, 10:10 AM
m3ckon m3ckon is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Sheffield UK
Posts: 69 m3ckon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 m 57 sec
Reputation Power: 5
Pank,

I meant in Access, go to tools ..security ... User and Group permissions and check the permissions on the tables for the user admin

M3ckon

Reply With Quote
  #14  
Old November 18th, 2003, 10:30 AM
pank pank is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 9 pank User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Sorry M3ckon, i get what u mean. All my permissions in Access is checked. Now i really don't know what is going on....~sigh~

Reply With Quote
  #15  
Old November 18th, 2003, 10:36 AM
m3ckon m3ckon is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Sheffield UK
Posts: 69 m3ckon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 m 57 sec
Reputation Power: 5
OK then, one more try for you ...

try using a dynamic cursoue instead of Static

So change this line:
rs.Open "Customer_Records",conn,3,3

To

rs.Open "Customer_Records",conn,2,3


M3ckon

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > Can't update MS Access DB


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump