asp ado problem.
-
Every time I run the code below, it tells me "No update permissions!"
Update Record
<% set conn=Server.CreateObject("ADODB.Connection") conn.Provider="Microsoft.Jet.OLEDB.4.0" conn.Open(Server.mapPath("chem.mdb")) cid=Request.Form("shit") response.write(Request.Form("test1")) jon = 1 response.write(jon) if Request.form("test1")<>"" then sql="UPDATE NEWS SET " sql=sql & "DATE='" & now() & "'," sql=sql & "CONTENT='" & Request.Form("test1") & "'" sql=sql & " WHERE ID='" & jon & "'" on error resume next conn.Execute sql, Recordsaffected if err<>0 then response.write("No update permissions!") else response.write("Record " & cid & " was updated!") end if end if conn.close %>
-
Every time I run the code below, it tells me "No update permissions!"
Update Record
<% set conn=Server.CreateObject("ADODB.Connection") conn.Provider="Microsoft.Jet.OLEDB.4.0" conn.Open(Server.mapPath("chem.mdb")) cid=Request.Form("shit") response.write(Request.Form("test1")) jon = 1 response.write(jon) if Request.form("test1")<>"" then sql="UPDATE NEWS SET " sql=sql & "DATE='" & now() & "'," sql=sql & "CONTENT='" & Request.Form("test1") & "'" sql=sql & " WHERE ID='" & jon & "'" on error resume next conn.Execute sql, Recordsaffected if err<>0 then response.write("No update permissions!") else response.write("Record " & cid & " was updated!") end if end if conn.close %>
RomanD wrote: Every time I run the code below, it tells me "No update permissions!" I would guess that there is an error in the SQL statement. I would also guess that err does not necessariliy indicate a permissions problem, but your code assumes that any error must be a permissions problem. You should find out what err actually is, and find out what that error number actually means.
Do you want to know more? WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and Forums
-
Every time I run the code below, it tells me "No update permissions!"
Update Record
<% set conn=Server.CreateObject("ADODB.Connection") conn.Provider="Microsoft.Jet.OLEDB.4.0" conn.Open(Server.mapPath("chem.mdb")) cid=Request.Form("shit") response.write(Request.Form("test1")) jon = 1 response.write(jon) if Request.form("test1")<>"" then sql="UPDATE NEWS SET " sql=sql & "DATE='" & now() & "'," sql=sql & "CONTENT='" & Request.Form("test1") & "'" sql=sql & " WHERE ID='" & jon & "'" on error resume next conn.Execute sql, Recordsaffected if err<>0 then response.write("No update permissions!") else response.write("Record " & cid & " was updated!") end if end if conn.close %>
-
Every time I run the code below, it tells me "No update permissions!"
Update Record
<% set conn=Server.CreateObject("ADODB.Connection") conn.Provider="Microsoft.Jet.OLEDB.4.0" conn.Open(Server.mapPath("chem.mdb")) cid=Request.Form("shit") response.write(Request.Form("test1")) jon = 1 response.write(jon) if Request.form("test1")<>"" then sql="UPDATE NEWS SET " sql=sql & "DATE='" & now() & "'," sql=sql & "CONTENT='" & Request.Form("test1") & "'" sql=sql & " WHERE ID='" & jon & "'" on error resume next conn.Execute sql, Recordsaffected if err<>0 then response.write("No update permissions!") else response.write("Record " & cid & " was updated!") end if end if conn.close %>
-
Here is my newest code: sql="SELECT * FROM NEWS WHERE ID="&jon&";" Set rsSrc = Server.CreateObject("ADODB.Recordset") rsSrc.Open sql, oDBConn,0,3 if(not(rsSrc.EOF))then rsSrc("DATE")= Now() rsSrc("CONTENT")=Request.Form("test1") rsSrc.update end if rsSrc.close set rsSrc=nothing Now, the error message I get is that my database/object is readonly. But I think that's a problem with my host.
-
Here is my newest code: sql="SELECT * FROM NEWS WHERE ID="&jon&";" Set rsSrc = Server.CreateObject("ADODB.Recordset") rsSrc.Open sql, oDBConn,0,3 if(not(rsSrc.EOF))then rsSrc("DATE")= Now() rsSrc("CONTENT")=Request.Form("test1") rsSrc.update end if rsSrc.close set rsSrc=nothing Now, the error message I get is that my database/object is readonly. But I think that's a problem with my host.
I suspect that the user account that your ASP page is running under - typically IUSR_machinename - doesn't have NTFS write permissions to the directory that contains the .MDB file. Hence the database is opened read-only and you can't insert new rows or update or delete existing ones. The account needs to be able to write to the directory, not just the file, as the Jet database engine needs to create an .ldb file if multiple connections access the file concurrently. Stability. What an interesting concept. -- Chris Maunder