Solved

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

Posted on 2008-10-07
8
364 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Error viewing ASP page 12 177
Help with query 3 36
Connecting to multiple databases to create a Dashboard 5 65
Multiflying 2 Input Text On a Table 7 31
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
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/…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

756 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