Solved

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

Posted on 2008-10-07
8
360 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

895 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now