Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

PLEASE Help, Hellish Update syntax error again (8.02)

LEGEND ,
Dec 01, 2006 Dec 01, 2006

Copy link to clipboard

Copied

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>


TOPICS
Server side applications

Views

365
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 04, 2006 Dec 04, 2006

Copy link to clipboard

Copied

The syntex error is being caused because PASSWORD is a reserved word now,
whereas it never used to be. Try changing the name of the field to something
like UserPassword

--
Paul Whitham
Certified Dreamweaver MX2004 Professional
Adobe Community Expert - Dreamweaver

Valleybiz Internet Design
www.valleybiz.net

"MaryAnn-Tade's Studio" <tade@visualedge.co.uk> wrote in message
news:ekppc3$gpn$1@forums.macromedia.com...
>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>
>


Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 05, 2006 Dec 05, 2006

Copy link to clipboard

Copied

LATEST
Thanks Paul, worked like magic. Wasn't magic though, just your expertise:)
"Paul Whitham AdobeCommunityExpert" <design@valleybiz.net> wrote in message
news:el2efo$kkc$1@forums.macromedia.com...
> The syntex error is being caused because PASSWORD is a reserved word now,
> whereas it never used to be. Try changing the name of the field to
> something like UserPassword
>
> --
> Paul Whitham
> Certified Dreamweaver MX2004 Professional
> Adobe Community Expert - Dreamweaver
>
> Valleybiz Internet Design
> www.valleybiz.net
>
> "MaryAnn-Tade's Studio" <tade@visualedge.co.uk> wrote in message
> news:ekppc3$gpn$1@forums.macromedia.com...
>>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>
>>
>
>


Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines