|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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:
Why will this happened? Thks! |
|
#2
|
|||
|
|||
|
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! |
|
#3
|
|||
|
|||
|
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.
|
|
#4
|
|||
|
|||
|
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
|
|
#5
|
|||
|
|||
|
|
|
#6
|
|||
|
|||
|
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? |
|
#7
|
|||
|
|||
|
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. |
|
#8
|
|||
|
|||
|
Quote:
Sorry for the trouble.... but how can i do the above? |
|
#9
|
|||
|
|||
|
http://www.webwizguide.info/asp/faq...permissions.asp
Amazing what this will show you: http://www.google.com/search?q=Writ...+Windows+XP+Pro |
|
#10
|
|||
|
|||
|
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?? |
|
#11
|
|||
|
|||
|
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 |
|
#12
|
|||
|
|||
|
Thks M3ckon, in fact my admin acc already have all kinds of permissions. I don't think this is the prob. thks anyway.
|
|
#13
|
|||
|
|||
|
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 |
|
#14
|
|||
|
|||
|
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~
|
|
#15
|
|||
|
|||
|
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 |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > Can't update MS Access DB |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|