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("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
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
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
var strContentImage1 = Request.Form("oEditContentImage1").Count >0 ? Request.Form("oEditContentSubTitle").Item(1) : "";
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
var bMoreContents = FormGetInteger("iMoreContents", 0) == 1 ?0 ? Request.Form("oTextAreaContentBody").Item(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