JScript Error 800a1391 'MM_NameOfPage_STRING' is undefined

J

JNariss

Hello,

I have created a connection to one of my databases using DreamWeaver
and created a form. When I go to preview the form in a browser I can
see it and fill out fields. However when I click the submit button I
receive the following error:

Microsoft JScript runtime error '800a1391'

'MM_ITEmpStat_STRING' is undefined

/Connections/ITESC.asp, line 23



The code scripting behind my form is:

<%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%>
<!--#include virtual="/Connections/EmployeeStatusChange.asp" -->
<%
// *** Edit Operations: declare variables

// set the form action variable
var MM_editAction = Request.ServerVariables("SCRIPT_NAME");
if (Request.QueryString) {
MM_editAction += "?" + Server.HTMLEncode(Request.QueryString);
}

// boolean to abort record edit
var MM_abortEdit = false;

// query string to execute
var MM_editQuery = "";
%>
<%
// *** Insert Record: set variables

if (String(Request("MM_insert")) == "form1") {

var MM_editConnection = MM_ITEmpStat_STRING;
var MM_editTable = "MacForm";
var MM_editRedirectUrl = "ESCThankYou.asp";
var MM_fieldsStr =
"NewHire|value|Change|value|Transfer|value|TransferFrom|value|TransferTo|value|TypeOfEmployee|value|TempNumberOfDays|value|EmployeeName|value|Title|value|PayNumber|value|Department|value|StartDate|value|EndDate|value|ManagersName|value|ManagersPhone|value|Location|value|TelecommunicationDevice|value|PCType|value|MonitorType|value|PrinterType|value|ARNumber|value|PCSerialNumber|value|AssetTag|value|WirelessNic|value|RASVPN|value|BPCS|value|LogPro|value|Payroll|value|AdditionalSoftwareRequests|value|Headset|value|HeadsetOptions|value|OmitLongDistance|value|OmitInternationalDialing|value|BuildingAccess|value|CommentsNotes|value|RequestedBy|value|Date|value";
var MM_columnsStr =
"NewHire|none,1,0|Change|none,1,0|Transfer|none,1,0|TransferFrom|',none,''|TransferTo|',none,''|TypeOfEmployee|',none,''|TempNumberOfDays|',none,''|EmployeeName|',none,''|Title|',none,''|PayNumber|',none,''|Department|',none,''|StartDate|',none,NULL|EndDate|',none,NULL|ManagersName|',none,''|ManagersPhone|',none,''|Location|',none,''|TelecommunicationDevice|',none,''|PCType|',none,''|MonitorType|',none,''|PrinterType|',none,''|ARNumber|',none,''|PCSerialNumber|',none,''|AssetTag|',none,''|WirelessNic|none,none,NULL|RASVPN|none,none,NULL|BPCS|none,1,0|LogPro|none,1,0|Payroll|none,1,0|AdditionalSoftwareRequests|',none,''|Headset|none,1,0|HeadsetOptions|',none,''|OmitLongDistance|none,1,0|OmitInternationalDialing|none,1,0|BuildingAccess|none,1,0|CommentsNotes|',none,''|RequestedBy|',none,''|Date|',none,NULL";

// create the MM_fields and MM_columns arrays
var MM_fields = MM_fieldsStr.split("|");
var MM_columns = MM_columnsStr.split("|");

// set the form values
for (var i=0; i+1 < MM_fields.length; i+=2) {
MM_fields[i+1] = String(Request.Form(MM_fields));
}

// append the query string to the redirect URL
if (MM_editRedirectUrl && Request.QueryString &&
Request.QueryString.Count > 0) {
MM_editRedirectUrl += ((MM_editRedirectUrl.indexOf('?') ==
-1)?"?":"&") + Request.QueryString;
}
}
%>
<%
// *** Insert Record: construct a sql insert statement and execute it

if (String(Request("MM_insert")) != "undefined") {

// create the sql insert statement
var MM_tableValues = "", MM_dbValues = "";
for (var i=0; i+1 < MM_fields.length; i+=2) {
var formVal = MM_fields[i+1];
var MM_typesArray = MM_columns[i+1].split(",");
var delim = (MM_typesArray[0] != "none") ? MM_typesArray[0] :
"";
var altVal = (MM_typesArray[1] != "none") ? MM_typesArray[1] :
"";
var emptyVal = (MM_typesArray[2] != "none") ? MM_typesArray[2] :
"";
if (formVal == "" || formVal == "undefined") {
formVal = emptyVal;
} else {
if (altVal != "") {
formVal = altVal;
} else if (delim == "'") { // escape quotes
formVal = "'" + formVal.replace(/'/g,"''") + "'";
} else {
formVal = delim + formVal + delim;
}
}
MM_tableValues += ((i != 0) ? "," : "") + MM_columns;
MM_dbValues += ((i != 0) ? "," : "") + formVal;
}
MM_editQuery = "insert into " + MM_editTable + " (" + MM_tableValues
+ ") values (" + MM_dbValues + ")";

if (!MM_abortEdit) {
// execute the insert
var MM_editCmd = Server.CreateObject('ADODB.Command');
MM_editCmd.ActiveConnection = MM_editConnection;
MM_editCmd.CommandText = MM_editQuery;
MM_editCmd.Execute();
MM_editCmd.ActiveConnection.Close();

if (MM_editRedirectUrl) {
Response.Redirect(MM_editRedirectUrl);
}
}

}
%>


With line 23 being: var MM_editConnection = MM_ITEmpStat_STRING;

I have searched my little heart out for days trying to figure this damn
form out. And have come up with error after error. Now that I can
finally preview the form I feel I am well on my way to it almost being
completed.

Could someone please take the time to try to help me figure this out?

Thanks,
Justine
 
T

Thomas 'PointedEars' Lahn

VK said:
Microsoft JScript runtime error '800a1391'

'MM_ITEmpStat_STRING' is undefined

[...]
By JScript errors table it's #5009 "Undefined identifier", so the
error message matches to the error type.

As it was to be expected.
Indeed simple text search shows that MM_ITEmpStat_STRING was never
declared not initialized, at least in the posted code. I guess you
need to ask from the Dreamweaver support team where this var supposes
to appear and why it did not in your case.

It is possible that the script that was supposed to be included with

contains that declaration and does not exist (there). The IIS reference
material also uses `<!-- #include ... -->' always (note the leading space),
but maybe that does not matter here.

See also
<URL:http://www.microsoft.com/windows2000/en/server/iis/htm/asp/iiwainc.htm>


PointedEars
 

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,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top