Solved

ASP (classic) application throws error -- permissions problem?

Posted on 2008-10-07
8
361 Views
Last Modified: 2012-08-13
Hi. I am having trouble with an ASP (Classic) application.

The application is called directory_edit.asp. I append its full code. It is a simple application used to edit a directory of people in a database table.

When I try to edit a record, I get this error:

Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query.

/maint/directory_edit.asp, line 55


So, it looks like a permissions problem? This application was ported over from another server, where it was working fine. I suspect the classic ASP code is OK, but there is a permissions problem?

I am grateful as always for any advice.

peace,

Eric
<!-- #include file = "header_maint_inc.asp" -->
<div id="content">
 
		<h2>Edit/Create a Directory Entry</h2>
<%
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open session("conn_CarePlanners_db")
if request("id") <> "" and isNumeric(request("id")) then
	record_id = request("id")
else
	record_id = "0"
end if
if request("sign_up") = "YES" then
	sign_up = true
else
	sign_up = false
end if
 
 
if request("action") = "Update" then
	sql = "update directory set "
	sql = sql & "prefix = " & quotestring(request("prefix"),",")
	sql = sql & "firstname = " & quotestring(request("firstname"),",")
	sql = sql & "middleinit = " & quotestring(request("middleinit"),",")
	sql = sql & "lastname = " & quotestring(request("lastname"),",")
	sql = sql & "suffix = " & quotestring(request("suffix"),",")
	sql = sql & "company = " & quotestring(request("company"),",")
	sql = sql & "region = " & quotestring(request("region"),",")
	sql = sql & "primaryphone = " & quotestring(request("primaryphone"),",")
	sql = sql & "email = " & quotestring(request("email"),",")
	sql = sql & "website = " & quotestring(request("website"),",")
	sql = sql & "street1 = " & quotestring(request("street1"),",")
	sql = sql & "city1 = " & quotestring(request("city1"),",")
	sql = sql & "state1 = " & quotestring(request("state1"),",")
	sql = sql & "zip1 = " & quotestring(request("zip1"),",")
	sql = sql & "country1 = " & quotestring(request("country1"),",")
	sql = sql & "phone1 = " & quotestring(request("phone1"),",")
	sql = sql & "fax1 = " & quotestring(request("fax1"),",")
	sql = sql & "street2 = " & quotestring(request("street2"),",")
	sql = sql & "city2 = " & quotestring(request("city2"),",")
	sql = sql & "state2 = " & quotestring(request("state2"),",")
	sql = sql & "zip2 = " & quotestring(request("zip2"),",")
	sql = sql & "country2 = " & quotestring(request("country2"),",")
	sql = sql & "phone2 = " & quotestring(request("phone2"),",")
	sql = sql & "fax2 = " & quotestring(request("fax2"),",")
	sql = sql & "chbdegrees = " & quotestring(request("chbdegrees"),",")
	sql = sql & "chbcertifications = " & quotestring(request("chbcertifications"),",")
	sql = sql & "practice = " & quotestring(request("practice"),",")
	sql = sql & "chbpediatric = " & quotestring(request("chbpediatric"),",")
	sql = sql & "chbadult = " & quotestring(request("chbadult"),",")
	sql = sql & "info = " & quotestring(request("info"),",")
	sql = sql & "sign_up = " & sign_up & ","
	sql = sql & "verified = " & request("verified")
	sql = sql & " where id = " & record_id
	conn.execute(sql)
	conn.close
	set conn = nothing
	%>
	<script>
	alert("Direcory record was updated.")
	document.location = "index.asp"
	</script>
	<%
end if
if request("action") = "Delete" then
	sql = "delete * from  directory where id = " & record_id
	conn.execute(sql)
	conn.close
	set conn = nothing
	%>
	<script>
	alert("Direcory record was deleted.")
	document.location = "index.asp"
	</script>
	<%
end if
if request("action") = "Submit" then
    %><!-- #include file = "registration_save_inc.asp" --><%
	if (firstname = "" or lastname = "" or company = "" or primaryphone = "" or email = "" or street1 = "" or city1 = "" or state1 = "" or zip1 = "" or country1 = "" or phone1 = "" or chbdegrees = "" or chbcertifications = "" or practice = "" or chbpediatric = "" or chbadult ="") and request("action") = "Submit" then
		%><script>alert('You did not fill a required field. All fields marked * are required.')</script><%
	end if
end if
 
 
sql = "select * from directory where id = " & record_id
set RS = conn.execute(sql)
if not RS.eof then
	prefix            = RS("prefix")
	firstname         = RS("firstname")
	middleinit        = RS("middleinit")
	lastname          = RS("lastname")
	suffix            = RS("suffix")
	company           = RS("company")
	region            = RS("region")
	primaryphone      = RS("primaryphone")
	email             = RS("email")
	website           = RS("website")
	street1           = RS("street1")
	city1             = RS("city1")
	state1            = RS("state1")
	zip1              = RS("zip1")
	country1          = RS("country1")
	phone1            = RS("phone1")
	fax1              = RS("fax1")
	street2           = RS("street2")
	city2             = RS("city2")
	state2            = RS("state2")
	zip2              = RS("zip2")
	country2          = RS("country2")
	phone2            = RS("phone2")
	fax2              = RS("fax2")
	chbdegrees        = RS("chbdegrees")
	chbcertifications = RS("chbcertifications")
	practice          = RS("practice")
	chbpediatric      = RS("chbpediatric")
	chbadult          = RS("chbadult")
	info              = RS("info")
	verified          = RS("verified")
	sign_up		   = RS("sign_up")
end if
Rs.close
set RS = nothing
conn.close
set conn = nothing
 
function quotestring(s, endchar)
	s = replace(trim(s),"'","''")
   	quotestring = "'" & s & "'" & endchar
end function
 
maint = true
%>
<form name="regform" method="post" action="directory_edit.asp?id=<%=record_id%>">
	<!-- #include virtual = "/directory_form_inc.asp" -->
</form>
	
 
</div>
<!-- #include file = "footer_maint_inc.asp" -->

Open in new window

0
Comment
Question by:Eric Bourland
  • 3
  • 3
  • 2
8 Comments
 
LVL 5

Assisted Solution

by:Devario Johnson
Devario Johnson earned 100 total points
ID: 22663682
yes, it does sound like a permissions issue.  Do you have root or console access to your server / Database?

Is this an access Database?

I would reccomend going into your hosting Control Panel and while on the server in the file browser, set the permissions there, as opposed to doing it through a GUI.

If u cant do that Shell into it and then

CHMOD 0777 Databasenamehere.mdb
0
 
LVL 5

Expert Comment

by:Devario Johnson
ID: 22663710
second thought try a 0755

777 is the most "writeable" but if you can get to 0755 to work that would be better
0
 
LVL 3

Author Comment

by:Eric Bourland
ID: 22663779
Hi. Thanks for this. I should have said: It is a Windows 2003 server. Using ASP classic.

Is there a user to whom or application to which I need to grant rights to write or execute a program?
0
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
LVL 82

Expert Comment

by:hielo
ID: 22664712
>>Is there a user to whom or application to which I need to grant rights to write or execute a program?
IUSR_ is the name of you server.
0
 
LVL 82

Accepted Solution

by:
hielo earned 400 total points
ID: 22664719
0
 
LVL 3

Author Comment

by:Eric Bourland
ID: 22665060
hielo -- very helpful. I will try this and get back to you. Eric
0
 
LVL 3

Author Closing Comment

by:Eric Bourland
ID: 31504002
hielo -- it worked. Thank you. I also had to give folder permission to the authenticated user who has access to that folder.

devarioj -- thank you very much for your help, as well.

Have a great evening.

Eric
0
 
LVL 82

Expert Comment

by:hielo
ID: 22668828
you are welcome.
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question