problem running code...

  • Thread starter Christopher Brandsdal
  • Start date
C

Christopher Brandsdal

Hi!

I have a problem running my code on 2000 server and iis5.0.

The code runs perfectly on my localhost (xp iis5.1) but when i run it on
2000 server iis5.0 I get this error:

--------------------------------------

operation must use an updateable query

execute_insert_text_content.asp l 83
--------------------------------------

My code looks like this:


''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

<%@ LANGUAGE=JScript %>
<% Session.LCID = 1044 %>
<OBJECT id=cn PROGID="ADODB.Connection" RUNAT="server"></OBJECT>
<OBJECT id=rst PROGID="ADODB.Recordset" RUNAT="server"></OBJECT>
<OBJECT id=cm PROGID="ADODB.Command" RUNAT="server"></OBJECT>

<!--#include file="./library/utils.inc"-->
<!--#include file="./library/adojavas.inc"-->
<!--#include file="./library/db.inc"-->

<%
Response.Buffer = true;

CheckUser(Application("UserLevel"));

var sSQL = "";

var iNodeId = FormGetInteger("iNodeId", -1);
var iLanguageId = FormGetInteger("oComboLanguageId", -1);
var iListId = FormGetInteger("iListId", -1);
var strContentTitle = Request.Form("oEditContentTitle").Count > 0
? Request.Form("oEditContentTitle").Item(1) : "";
var strContentSubTitle = Request.Form("oEditContentSubTitle").Count
0 ? Request.Form("oEditContentSubTitle").Item(1) : "";
var strContentImage1 = Request.Form("oEditContentImage1").Count >
0 ? Request.Form("oEditContentImage1").Item(1) : "";
var strContentImage2 = Request.Form("oEditContentImage2").Count >
0 ? Request.Form("oEditContentImage2").Item(1) : "";
var strDocumentLink = Request.Form("oEditDocumentLink").Count > 0
? Request.Form("oEditDocumentLink").Item(1) : "";
var strDocumentLinkDescription =
Request.Form("oEditDocumentLinkDescription").Count > 0 ?
Request.Form("oEditDocumentLinkDescription").Item(1) : "";
var strContentBody = Request.Form("oTextAreaContentBody").Count
0 ? Request.Form("oTextAreaContentBody").Item(1) : "";
var bMoreContents = FormGetInteger("iMoreContents", 0) == 1 ?
true : false;
var Fil1 = Request.Form("Fil1").Count > 0 ?
Request.Form("Fil1").Item(1) : "";
var Fil2 = Request.Form("Fil2").Count > 0 ?
Request.Form("Fil2").Item(1) : "";
var Fil3 = Request.Form("Fil3").Count > 0 ?
Request.Form("Fil3").Item(1) : "";
var Fil4 = Request.Form("Fil4").Count > 0 ?
Request.Form("Fil4").Item(1) : "";

if((iNodeId == -1) || (iLanguageId == -1) || (iListId == -1))
Response.Redirect("./tree_cms.asp");

cn.Open(Application("ADOConnectionString"));

cm.ActiveConnection = cn;

sSQL = "SELECT content_id FROM Content_Text WHERE topic_id=" + iNodeId;
sSQL += " AND language_id=" + iLanguageId + " AND list_id=" + iListId + "
AND preview=0";

rst.Open(sSQL, cn);

if(!rst.EOF)
{
// Update
cm.CommandText = "UPDATE Content_Text SET title = ?, sub_title = ?, body =
?, picture_file_name_1 = ?, ";
cm.CommandText += "picture_file_name_2 = ?, Fil1 = ?, Fil2 = ?, Fil3 = ?,
Fil4 = ?, document_link = ?, document_link_description = ?,";
cm.CommandText += "modification_date = " + GetActualDbDate() + ", user_name
= ? WHERE content_id=?";
cm.Parameters.Append(cm.CreateParameter("title", adVarChar, adParamInput,
255));
cm.Parameters.Append(cm.CreateParameter("sub_title", adVarChar,
adParamInput, 255));
cm.Parameters.Append(cm.CreateParameter("body", adLongVarWChar,
adParamInput, 20480000));
cm.Parameters.Append(cm.CreateParameter("picture_file_name_1", adVarChar,
adParamInput, 255));
cm.Parameters.Append(cm.CreateParameter("picture_file_name_2", adVarChar,
adParamInput, 255));
cm.Parameters.Append(cm.CreateParameter("Fil1", adVarChar, adParamInput,
255));
cm.Parameters.Append(cm.CreateParameter("Fil2", adVarChar, adParamInput,
255));
cm.Parameters.Append(cm.CreateParameter("Fil3", adVarChar, adParamInput,
255));
cm.Parameters.Append(cm.CreateParameter("Fil4", adVarChar, adParamInput,
255));
cm.Parameters.Append(cm.CreateParameter("document_link", adVarChar,
adParamInput, 255));
cm.Parameters.Append(cm.CreateParameter("document_link_description",
adVarChar, adParamInput, 255));
cm.Parameters.Append(cm.CreateParameter("user_name", adVarChar,
adParamInput, 255));
cm.Parameters.Append(cm.CreateParameter("content_id", adInteger,
adParamInput));


cm("title") = CutString(strContentTitle, 255);
cm("sub_title") = CutString(strContentSubTitle, 255);
cm("body") = strContentBody;
cm("picture_file_name_1") = CutString(strContentImage1, 255);
cm("picture_file_name_2") = CutString(strContentImage2, 255);
cm("Fil1") = CutString(Fil1, 255);
cm("Fil2") = CutString(Fil2, 255);
cm("Fil3") = CutString(Fil3, 255);
cm("Fil4") = CutString(Fil4, 255);
cm("document_link") = CutString(strDocumentLink, 255);
cm("document_link_description") = CutString(strDocumentLinkDescription,
255);
cm("user_name") = Session("UserName");
cm("content_id") = rst("content_id").value;


83 cm.Execute();
}
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''


line 83: cm.Execute();

Why does i work on my xp, but not on the 2000 server??????

I have also uploaded my code to another server, and it worked perfectly
there also..

Is there maby some options in iis that are set wrong???


Thanks!

Christopher Brandsdal
 
K

Ken Schaefer

This is an NTFS permissions problem. Give the IUSR_<machinename> account (or
whatever user context you are using) Read/Write permissions to the folder
(and files) where the .mdb file is, and also to the Windows temp directory.

Cheers
Ken


: Hi!
:
: I have a problem running my code on 2000 server and iis5.0.
:
: The code runs perfectly on my localhost (xp iis5.1) but when i run it on
: 2000 server iis5.0 I get this error:
:
: --------------------------------------
:
: operation must use an updateable query
:
: execute_insert_text_content.asp l 83
: --------------------------------------
:
: My code looks like this:
:
<snip>
 
C

Christopher Brandsdal

hmm.. I have done this...
But it still won't work!
I think something else must be the problem..
 
B

Bob Barrows

Assuming this is an Access database (why wouldn't you think this information
was relevant? Always tell us the type and version of database you are using
when asking a database-related question - we are not looking over your
shoulder <grin>) I agree with Ken that this is a permissions issue. See
these articles:
http://www.aspfaq.com/show.asp?id=2062 - updatable cursor
http://www.aspfaq.com/show.asp?id=2009 - 80004005 errors

Depending on where this query is being run (in a regular page, or in the
session_onend event in global.asa), you need to give folder-level Change
permissions to both the IUSR and IWAM accounts for the folder containing the
database. Do not assume these accounts are in the Everyone group (they're
not).

Also, if the database is on a remote machine, the account used to access
that database must be a domain-level account:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;253580


Finally, there is a slight possibility that the query itself is at fault, so
you should response.write the CommandText and see if it's a runnable query.

HTH,
Bob Barrows
 
K

Ken Schaefer

Check the permissions again!

If IUSR_<machinename> has Read/Write (RXW) then Creator/Owner needs Full
Control.
Otherwise, if you are have remove the special CreatorOwner user, then
IUSR_<machinename> needs Change (RWXD) permissions.

This is because Access needs to create the .ldb lockfile, which is created
in the same folder as the .mdb file. And it needs to delete it later on. So,
either IUSR_<machinename> needs Change (RWXD) or, since it is the Owner of
the .ldb lockfile, Creator/Owner needs Change (by default, I think C/O has
Full Control).

Cheers
Ken

: hmm.. I have done this...
: But it still won't work!
: I think something else must be the problem..
:
: "Ken Schaefer" <[email protected]> skrev i melding
: : > This is an NTFS permissions problem. Give the IUSR_<machinename> account
: (or
: > whatever user context you are using) Read/Write permissions to the
folder
: > (and files) where the .mdb file is, and also to the Windows temp
: directory.
: >
: > Cheers
: > Ken
: >
: >
: > : > : Hi!
: > :
: > : I have a problem running my code on 2000 server and iis5.0.
: > :
: > : The code runs perfectly on my localhost (xp iis5.1) but when i run it
on
: > : 2000 server iis5.0 I get this error:
: > :
: > : --------------------------------------
: > :
: > : operation must use an updateable query
: > :
: > : execute_insert_text_content.asp l 83
: > : --------------------------------------
: > :
: > : My code looks like this:
: > :
: > <snip>
: >
: >
:
:
 
H

HarryD

also check microsoft.com website
there is a known issue with read-rights on a specific key in the registry
 
C

Christopher Brandsdal

Thanks!
oops..
I forgot that when I burn the files to a cd it autmaticly makes them "read
only" when I copy them back to disc....

I AM SO SORRY :)

Thanks ALOT for helping me realize that there's nothing wrong with the
system, it's just me ;)
 
K

Ken Schaefer

Oh yeah - that's another issue I didn't even think of!

You run into this as well if you put your .mdb file inside your webroot, and
you run the FPSE "tighten security" wizard, and your .mdb file isn't inside
the "special" /fpdb folder.

Glad you got it sorted out.

Cheers
Ken

: Thanks!
: oops..
: I forgot that when I burn the files to a cd it autmaticly makes them "read
: only" when I copy them back to disc....
:
: I AM SO SORRY :)
:
: Thanks ALOT for helping me realize that there's nothing wrong with the
: system, it's just me ;)
:
:
: "Ken Schaefer" <[email protected]> skrev i melding
: : > Check the permissions again!
: >
: > If IUSR_<machinename> has Read/Write (RXW) then Creator/Owner needs Full
: > Control.
: > Otherwise, if you are have remove the special CreatorOwner user, then
: > IUSR_<machinename> needs Change (RWXD) permissions.
: >
: > This is because Access needs to create the .ldb lockfile, which is
created
: > in the same folder as the .mdb file. And it needs to delete it later on.
: So,
: > either IUSR_<machinename> needs Change (RWXD) or, since it is the Owner
of
: > the .ldb lockfile, Creator/Owner needs Change (by default, I think C/O
has
: > Full Control).
: >
: > Cheers
: > Ken
: >
: > : > : hmm.. I have done this...
: > : But it still won't work!
: > : I think something else must be the problem..
: > :
: > : "Ken Schaefer" <[email protected]> skrev i melding
: > : : > : > This is an NTFS permissions problem. Give the IUSR_<machinename>
: account
: > : (or
: > : > whatever user context you are using) Read/Write permissions to the
: > folder
: > : > (and files) where the .mdb file is, and also to the Windows temp
: > : directory.
: > : >
: > : > Cheers
: > : > Ken
: > : >
: > : >
: > : > : > : > : Hi!
: > : > :
: > : > : I have a problem running my code on 2000 server and iis5.0.
: > : > :
: > : > : The code runs perfectly on my localhost (xp iis5.1) but when i run
: it
: > on
: > : > : 2000 server iis5.0 I get this error:
: > : > :
: > : > : --------------------------------------
: > : > :
: > : > : operation must use an updateable query
: > : > :
: > : > : execute_insert_text_content.asp l 83
: > : > : --------------------------------------
: > : > :
: > : > : My code looks like this:
: > : > :
: > : > <snip>
: > : >
: > : >
: > :
: > :
: >
: >
:
:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,185
Latest member
GluceaReviews

Latest Threads

Top