Question
PLEASE Help, Hellish Update syntax error again (8.02)
I would be grateful if anyone could help out on this. I am
completely at
loss as to what is going on.
Somehow DW8.02 does not properly generate syntax for update, delete, insert
etc.
All my files work properly on DWMX but bringing them over to DW8.02 has led
to great difficulties, missed deadlines etc.
In this instance I have reapplied the server behaviours in dw8.02, removed
the serverScripts, started from scratch even! but still get an UPDATE syntax
error.
The erroneous code is being generated by Dreamweaver! The situation is
really become hellish
I have pasted the relevant section of the code below:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="../Connections/Nigeriapharm.asp" -->
<%
Dim MM_editAction
MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME"))
If (Request.QueryString <> "") Then
MM_editAction = MM_editAction & "?" &
Server.HTMLEncode(Request.QueryString)
End If
' boolean to abort record edit
Dim MM_abortEdit
MM_abortEdit = false
%>
<%
' IIf implementation
Function MM_IIf(condition, ifTrue, ifFalse)
If condition = "" Then
MM_IIf = ifFalse
Else
MM_IIf = ifTrue
End If
End Function
%>
<%
If (CStr(Request("MM_update")) = "form1") Then
If (Not MM_abortEdit) Then
' execute the update
Dim MM_editCmd
Set MM_editCmd = Server.CreateObject ("ADODB.Command")
MM_editCmd.ActiveConnection = MM_Nigeriapharm_STRING
MM_editCmd.CommandText = "UPDATE RegisterGeneral SET UserName = ?,
Password = ?, Promotions = ?, Title = ?, FirstName = ?, Surname = ?,
Telephone = ?, Email = ? WHERE RegisterID = ?"
MM_editCmd.Prepared = true
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param1", 202,
1, 50, Request.Form("Username")) ' adVarWChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param2", 202,
1, 50, Request.Form("Password")) ' adVarWChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param3", 202,
1, 50, Request.Form("Promotions")) ' adVarWChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param4", 202,
1, 50, Request.Form("Title")) ' adVarWChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param5", 202,
1, 50, Request.Form("FirstName")) ' adVarWChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param6", 202,
1, 50, Request.Form("Surname")) ' adVarWChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param7", 5,
1, -1, MM_IIF(Request.Form("Telephone"), Request.Form("Telephone"), null)) '
adDouble
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param8", 202,
1, 50, Request.Form("Email")) ' adVarWChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param9", 5,
1, -1, MM_IIF(Request.Form("MM_recordId"), Request.Form("MM_recordId"),
null)) ' adDouble
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close
' append the query string to the redirect URL
Dim MM_editRedirectUrl
MM_editRedirectUrl = "UserUpdateSuccess.asp"
If (Request.QueryString <> "") Then
If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0) Then
MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
Else
MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
End If
End If
Response.Redirect(MM_editRedirectUrl)
End If
End If
%>
<%
Dim rsUserUpdate__MMColParam
rsUserUpdate__MMColParam = "1"
If (Request.QueryString("RegisterID") <> "") Then
rsUserUpdate__MMColParam = Request.QueryString("RegisterID")
End If
%>
<%
Dim rsUserUpdate
Dim rsUserUpdate_cmd
Dim rsUserUpdate_numRows
Set rsUserUpdate_cmd = Server.CreateObject ("ADODB.Command")
rsUserUpdate_cmd.ActiveConnection = MM_Nigeriapharm_STRING
rsUserUpdate_cmd.CommandText = "SELECT * FROM RegisterGeneral WHERE
RegisterID = ?"
rsUserUpdate_cmd.Prepared = true
rsUserUpdate_cmd.Parameters.Append
rsUserUpdate_cmd.CreateParameter("param1", 5, 1, -1,
rsUserUpdate__MMColParam) ' adDouble
Set rsUserUpdate = rsUserUpdate_cmd.Execute
rsUserUpdate_numRows = 0
%>
<html><!-- InstanceBegin template="/Templates/admin.dwt.asp"
codeOutsideHTMLIsLocked="false" -->
<head>
<!-- InstanceBeginEditable name="doctitle" -->
<title>Untitled Document</title>
<!-- InstanceEndEditable -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable -->
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if
((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight;
onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH)
location.reload();
}
MM_reloadPage(true);
//-->
</script>
<link href="../shoestore.css" rel="stylesheet" type="text/css">
</head>
loss as to what is going on.
Somehow DW8.02 does not properly generate syntax for update, delete, insert
etc.
All my files work properly on DWMX but bringing them over to DW8.02 has led
to great difficulties, missed deadlines etc.
In this instance I have reapplied the server behaviours in dw8.02, removed
the serverScripts, started from scratch even! but still get an UPDATE syntax
error.
The erroneous code is being generated by Dreamweaver! The situation is
really become hellish
I have pasted the relevant section of the code below:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="../Connections/Nigeriapharm.asp" -->
<%
Dim MM_editAction
MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME"))
If (Request.QueryString <> "") Then
MM_editAction = MM_editAction & "?" &
Server.HTMLEncode(Request.QueryString)
End If
' boolean to abort record edit
Dim MM_abortEdit
MM_abortEdit = false
%>
<%
' IIf implementation
Function MM_IIf(condition, ifTrue, ifFalse)
If condition = "" Then
MM_IIf = ifFalse
Else
MM_IIf = ifTrue
End If
End Function
%>
<%
If (CStr(Request("MM_update")) = "form1") Then
If (Not MM_abortEdit) Then
' execute the update
Dim MM_editCmd
Set MM_editCmd = Server.CreateObject ("ADODB.Command")
MM_editCmd.ActiveConnection = MM_Nigeriapharm_STRING
MM_editCmd.CommandText = "UPDATE RegisterGeneral SET UserName = ?,
Password = ?, Promotions = ?, Title = ?, FirstName = ?, Surname = ?,
Telephone = ?, Email = ? WHERE RegisterID = ?"
MM_editCmd.Prepared = true
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param1", 202,
1, 50, Request.Form("Username")) ' adVarWChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param2", 202,
1, 50, Request.Form("Password")) ' adVarWChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param3", 202,
1, 50, Request.Form("Promotions")) ' adVarWChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param4", 202,
1, 50, Request.Form("Title")) ' adVarWChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param5", 202,
1, 50, Request.Form("FirstName")) ' adVarWChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param6", 202,
1, 50, Request.Form("Surname")) ' adVarWChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param7", 5,
1, -1, MM_IIF(Request.Form("Telephone"), Request.Form("Telephone"), null)) '
adDouble
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param8", 202,
1, 50, Request.Form("Email")) ' adVarWChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param9", 5,
1, -1, MM_IIF(Request.Form("MM_recordId"), Request.Form("MM_recordId"),
null)) ' adDouble
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close
' append the query string to the redirect URL
Dim MM_editRedirectUrl
MM_editRedirectUrl = "UserUpdateSuccess.asp"
If (Request.QueryString <> "") Then
If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0) Then
MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
Else
MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
End If
End If
Response.Redirect(MM_editRedirectUrl)
End If
End If
%>
<%
Dim rsUserUpdate__MMColParam
rsUserUpdate__MMColParam = "1"
If (Request.QueryString("RegisterID") <> "") Then
rsUserUpdate__MMColParam = Request.QueryString("RegisterID")
End If
%>
<%
Dim rsUserUpdate
Dim rsUserUpdate_cmd
Dim rsUserUpdate_numRows
Set rsUserUpdate_cmd = Server.CreateObject ("ADODB.Command")
rsUserUpdate_cmd.ActiveConnection = MM_Nigeriapharm_STRING
rsUserUpdate_cmd.CommandText = "SELECT * FROM RegisterGeneral WHERE
RegisterID = ?"
rsUserUpdate_cmd.Prepared = true
rsUserUpdate_cmd.Parameters.Append
rsUserUpdate_cmd.CreateParameter("param1", 5, 1, -1,
rsUserUpdate__MMColParam) ' adDouble
Set rsUserUpdate = rsUserUpdate_cmd.Execute
rsUserUpdate_numRows = 0
%>
<html><!-- InstanceBegin template="/Templates/admin.dwt.asp"
codeOutsideHTMLIsLocked="false" -->
<head>
<!-- InstanceBeginEditable name="doctitle" -->
<title>Untitled Document</title>
<!-- InstanceEndEditable -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable -->
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if
((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight;
onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH)
location.reload();
}
MM_reloadPage(true);
//-->
</script>
<link href="../shoestore.css" rel="stylesheet" type="text/css">
</head>
