Different Dreamweaver versions, different ASP Insert record coding?
hi. in our office have several different versions of dreamweaver (dreamweaver 8 , dreamweaver cs3). when developing asp pages our old version produce code handling insert record commands work fine. code looks similar following:
<%
' *** insert record: set variables
if (cstr(request("mm_insert")) = "seminarregistration")
mm_editconnection = mm_seminardatabase_string
mm_edittable = "seminarregistration"
mm_editredirecturl = "registration_successful.htm"
mm_fieldsstr = "firstname|value|lastname|value|address|value|city|value|state|value|zipcode|value|phone| value|fax|value|email|value|oetracker|value|license|value|ceaccount|value|eventname|value| eventdate|value|paymentamount|value|paymentmethod|value|ccnumber1|value|ccnumber2|value|cc number3|value|ccnumber4|value|cctype|value|ccexpiration|value|cvccode|value|ccbillingzipco de|value|meal|value|wdsinvoice|value|registrationdate|value|checkinstatus|value|confirmati onsent|value"
mm_columnsstr = "firstname|',none,''|lastname|',none,''|address|',none,''|city|',none,''|state|',none,''| zipcode|',none,''|phone|',none,''|fax|',none,''|email|',none,''|oetracker|',none,''|licens e|',none,''|ceaccount|',none,''|eventname|',none,''|eventdate|',none,''|paymentamount|',no ne,''|paymentmethod|',none,''|ccnumber1|',none,''|ccnumber2|',none,''|ccnumber3|',none,''| ccnumber4|',none,''|cctype|',none,''|ccexpiration|',none,''|cvccode|',none,''|ccbillingzip code|',none,''|meal|',none,''|wdsinvoice|',none,''|registrationdate|',none,''|checkinstatu s|',none,''|confirmationsent|',none,''"
' create mm_fields , mm_columns arrays
mm_fields = split(mm_fieldsstr, "|")
mm_columns = split(mm_columnsstr, "|")
' set form values
mm_i = lbound(mm_fields) ubound(mm_fields) step 2
mm_fields(mm_i+1) = cstr(request.form(mm_fields(mm_i)))
next
' append query string redirect url
if (mm_editredirecturl <> "" , request.querystring <> "")
if (instr(1, mm_editredirecturl, "?", vbtextcompare) = 0 , request.querystring <> "")
mm_editredirecturl = mm_editredirecturl & "?" & request.querystring
else
mm_editredirecturl = mm_editredirecturl & "&" & request.querystring
end if
end if
end if
%>
however, cs3 making code looks different code ive listed above. new code looks like:
<%
if (cstr(request("mm_insert")) = "seminarregistration")
if (not mm_abortedit)
' execute insert
dim mm_editcmd
set mm_editcmd = server.createobject ("adodb.command")
mm_editcmd.activeconnection = mm_seminardatabase_string
mm_editcmd.commandtext = "insert seminarregistration (firstname, lastname, address, city, [state], zipcode, phone, fax, email, oetracker, license, ceaccount, eventname, eventdate, paymentamount, paymentmethod, ccnumber1, ccnumber2, ccnumber3, ccnumber4, cctype, ccexpiration, cvccode, ccbillingzipcode, meal, wdsinvoice, registrationdate, checkinstatus, confirmationsent) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"
mm_editcmd.prepared = true
mm_editcmd.parameters.append mm_editcmd.createparameter("param1", 202, 1, 50, request.form("firstname")) ' advarwchar
mm_editcmd.parameters.append mm_editcmd.createparameter("param2", 202, 1, 50, request.form("lastname")) ' advarwchar
mm_editcmd.parameters.append mm_editcmd.createparameter("param3", 202, 1, 50, request.form("address")) ' advarwchar
mm_editcmd.parameters.append mm_editcmd.createparameter("param4", 202, 1, 50, request.form("city")) ' advarwchar
mm_editcmd.execute
mm_editcmd.activeconnection.close
' append query string redirect url
dim mm_editredirecturl
mm_editredirecturl = "registration_successful.htm"
if (request.querystring <> "")
if (instr(1, mm_editredirecturl, "?", vbtextcompare) = 0)
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
%>
the problem comes when trying use new code (dreamweaver putting in default when creating pages alter mysql database inserting / updating / or deleting records via asp. web browsers report breaks @ " mm_editcmd.execute" section. why this? why dreamweaver using new formatting? there way can make use old way?
thanks help.
-aaron
<%
' *** insert record: set variables
if (cstr(request("mm_insert")) = "seminarregistration")
mm_editconnection = mm_seminardatabase_string
mm_edittable = "seminarregistration"
mm_editredirecturl = "registration_successful.htm"
mm_fieldsstr = "firstname|value|lastname|value|address|value|city|value|state|value|zipcode|value|phone| value|fax|value|email|value|oetracker|value|license|value|ceaccount|value|eventname|value| eventdate|value|paymentamount|value|paymentmethod|value|ccnumber1|value|ccnumber2|value|cc number3|value|ccnumber4|value|cctype|value|ccexpiration|value|cvccode|value|ccbillingzipco de|value|meal|value|wdsinvoice|value|registrationdate|value|checkinstatus|value|confirmati onsent|value"
mm_columnsstr = "firstname|',none,''|lastname|',none,''|address|',none,''|city|',none,''|state|',none,''| zipcode|',none,''|phone|',none,''|fax|',none,''|email|',none,''|oetracker|',none,''|licens e|',none,''|ceaccount|',none,''|eventname|',none,''|eventdate|',none,''|paymentamount|',no ne,''|paymentmethod|',none,''|ccnumber1|',none,''|ccnumber2|',none,''|ccnumber3|',none,''| ccnumber4|',none,''|cctype|',none,''|ccexpiration|',none,''|cvccode|',none,''|ccbillingzip code|',none,''|meal|',none,''|wdsinvoice|',none,''|registrationdate|',none,''|checkinstatu s|',none,''|confirmationsent|',none,''"
' create mm_fields , mm_columns arrays
mm_fields = split(mm_fieldsstr, "|")
mm_columns = split(mm_columnsstr, "|")
' set form values
mm_i = lbound(mm_fields) ubound(mm_fields) step 2
mm_fields(mm_i+1) = cstr(request.form(mm_fields(mm_i)))
next
' append query string redirect url
if (mm_editredirecturl <> "" , request.querystring <> "")
if (instr(1, mm_editredirecturl, "?", vbtextcompare) = 0 , request.querystring <> "")
mm_editredirecturl = mm_editredirecturl & "?" & request.querystring
else
mm_editredirecturl = mm_editredirecturl & "&" & request.querystring
end if
end if
end if
%>
however, cs3 making code looks different code ive listed above. new code looks like:
<%
if (cstr(request("mm_insert")) = "seminarregistration")
if (not mm_abortedit)
' execute insert
dim mm_editcmd
set mm_editcmd = server.createobject ("adodb.command")
mm_editcmd.activeconnection = mm_seminardatabase_string
mm_editcmd.commandtext = "insert seminarregistration (firstname, lastname, address, city, [state], zipcode, phone, fax, email, oetracker, license, ceaccount, eventname, eventdate, paymentamount, paymentmethod, ccnumber1, ccnumber2, ccnumber3, ccnumber4, cctype, ccexpiration, cvccode, ccbillingzipcode, meal, wdsinvoice, registrationdate, checkinstatus, confirmationsent) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"
mm_editcmd.prepared = true
mm_editcmd.parameters.append mm_editcmd.createparameter("param1", 202, 1, 50, request.form("firstname")) ' advarwchar
mm_editcmd.parameters.append mm_editcmd.createparameter("param2", 202, 1, 50, request.form("lastname")) ' advarwchar
mm_editcmd.parameters.append mm_editcmd.createparameter("param3", 202, 1, 50, request.form("address")) ' advarwchar
mm_editcmd.parameters.append mm_editcmd.createparameter("param4", 202, 1, 50, request.form("city")) ' advarwchar
mm_editcmd.execute
mm_editcmd.activeconnection.close
' append query string redirect url
dim mm_editredirecturl
mm_editredirecturl = "registration_successful.htm"
if (request.querystring <> "")
if (instr(1, mm_editredirecturl, "?", vbtextcompare) = 0)
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
%>
the problem comes when trying use new code (dreamweaver putting in default when creating pages alter mysql database inserting / updating / or deleting records via asp. web browsers report breaks @ " mm_editcmd.execute" section. why this? why dreamweaver using new formatting? there way can make use old way?
thanks help.
-aaron
the code wasn't changed 8 cs3. changed 8 8.02
updater prevent sql injection attacks. looks didn't have
updater in dw8.
--
nancy gill
adobe community expert
author: dreamweaver 8 e-book dmx zone
co-author: dreamweaver mx: instant troubleshooter (august, 2003)
technical editor: dmx 2004: complete reference, dmx 2004: beginner''s
guide, mastering macromedia contribute
technical reviewer: dynamic dreamweaver mx/dmx: advanced php web development
"aaron cevision" <webforumsuser@macromedia.com> wrote in message
news:f1qtug$riu$1@forums.macromedia.com...
> hi. in our office have several different versions of dreamweaver
> (dreamweaver 8 , dreamweaver cs3). when developing asp pages our old
> version produce code handling insert record commands work
> fine.
> code looks similar following:
>
> <%
> ' *** insert record: set variables
>
> if (cstr(request("mm_insert")) = "seminarregistration")
>
> mm_editconnection = mm_seminardatabase_string
> mm_edittable = "seminarregistration"
> mm_editredirecturl = "registration_successful.htm"
> mm_fieldsstr =
> "firstname|value|lastname|value|address|value|city|value|state|value|zipcode|val
> ue|phone|value|fax|value|email|value|oetracker|value|license|value|ceaccount|val
> ue|eventname|value|eventdate|value|paymentamount|value|paymentmethod|value|ccnum
> ber1|value|ccnumber2|value|ccnumber3|value|ccnumber4|value|cctype|value|ccexpira
> tion|value|cvccode|value|ccbillingzipcode|value|meal|value|wdsinvoice|value|regi
> strationdate|value|checkinstatus|value|confirmationsent|value"
> mm_columnsstr =
> "firstname|',none,''|lastname|',none,''|address|',none,''|city|',none,''|state|'
> ,none,''|zipcode|',none,''|phone|',none,''|fax|',none,''|email|',none,''|oetrack
> er|',none,''|license|',none,''|ceaccount|',none,''|eventname|',none,''|eventdate
> |',none,''|paymentamount|',none,''|paymentmethod|',none,''|ccnumber1|',none,''|c
> cnumber2|',none,''|ccnumber3|',none,''|ccnumber4|',none,''|cctype|',none,''|ccex
> piration|',none,''|cvccode|',none,''|ccbillingzipcode|',none,''|meal|',none,''|w
> dsinvoice|',none,''|registrationdate|',none,''|checkinstatus|',none,''|confirmat
> ionsent|',none,''"
>
> ' create mm_fields , mm_columns arrays
> mm_fields = split(mm_fieldsstr, "|")
> mm_columns = split(mm_columnsstr, "|")
>
> ' set form values
> mm_i = lbound(mm_fields) ubound(mm_fields) step 2
> mm_fields(mm_i+1) = cstr(request.form(mm_fields(mm_i)))
> next
>
> ' append query string redirect url
> if (mm_editredirecturl <> "" , request.querystring <> "")
> if (instr(1, mm_editredirecturl, "?", vbtextcompare) = 0 ,
> request.querystring <> "")
> mm_editredirecturl = mm_editredirecturl & "?" & request.querystring
> else
> mm_editredirecturl = mm_editredirecturl & "&" & request.querystring
> end if
> end if
>
> end if
> %>
>
> however, cs3 making code looks different
> code ive listed above. new code looks like:
>
> <%
> if (cstr(request("mm_insert")) = "seminarregistration")
> if (not mm_abortedit)
> ' execute insert
> dim mm_editcmd
>
> set mm_editcmd = server.createobject ("adodb.command")
> mm_editcmd.activeconnection = mm_seminardatabase_string
> mm_editcmd.commandtext = "insert seminarregistration (firstname,
> lastname, address, city, [state], zipcode, phone, fax, email, oetracker,
> license, ceaccount, eventname, eventdate, paymentamount, paymentmethod,
> ccnumber1, ccnumber2, ccnumber3, ccnumber4, cctype, ccexpiration, cvccode,
> ccbillingzipcode, meal, wdsinvoice, registrationdate, checkinstatus,
> confirmationsent) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
> ?, ?,
> ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"
> mm_editcmd.prepared = true
> mm_editcmd.parameters.append mm_editcmd.createparameter("param1", 202,
> 1,
> 50, request.form("firstname")) ' advarwchar
> mm_editcmd.parameters.append mm_editcmd.createparameter("param2", 202,
> 1,
> 50, request.form("lastname")) ' advarwchar
> mm_editcmd.parameters.append mm_editcmd.createparameter("param3", 202,
> 1,
> 50, request.form("address")) ' advarwchar
> mm_editcmd.parameters.append mm_editcmd.createparameter("param4", 202,
> 1,
> 50, request.form("city")) ' advarwchar
> mm_editcmd.execute
> mm_editcmd.activeconnection.close
>
> ' append query string redirect url
> dim mm_editredirecturl
> mm_editredirecturl = "registration_successful.htm"
> if (request.querystring <> "")
> if (instr(1, mm_editredirecturl, "?", vbtextcompare) = 0)
> 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
> %>
>
> problem comes when trying use new code
> (dreamweaver
> putting in default when creating pages alter
> mysql
> database inserting / updating / or deleting records via asp. web
> browsers
> report breaks @ " mm_editcmd.execute" section.
> why
> this? why dreamweaver using new formatting? there way can
> make
> use old way?
>
> help.
>
> -aaron
>
updater prevent sql injection attacks. looks didn't have
updater in dw8.
--
nancy gill
adobe community expert
author: dreamweaver 8 e-book dmx zone
co-author: dreamweaver mx: instant troubleshooter (august, 2003)
technical editor: dmx 2004: complete reference, dmx 2004: beginner''s
guide, mastering macromedia contribute
technical reviewer: dynamic dreamweaver mx/dmx: advanced php web development
"aaron cevision" <webforumsuser@macromedia.com> wrote in message
news:f1qtug$riu$1@forums.macromedia.com...
> hi. in our office have several different versions of dreamweaver
> (dreamweaver 8 , dreamweaver cs3). when developing asp pages our old
> version produce code handling insert record commands work
> fine.
> code looks similar following:
>
> <%
> ' *** insert record: set variables
>
> if (cstr(request("mm_insert")) = "seminarregistration")
>
> mm_editconnection = mm_seminardatabase_string
> mm_edittable = "seminarregistration"
> mm_editredirecturl = "registration_successful.htm"
> mm_fieldsstr =
> "firstname|value|lastname|value|address|value|city|value|state|value|zipcode|val
> ue|phone|value|fax|value|email|value|oetracker|value|license|value|ceaccount|val
> ue|eventname|value|eventdate|value|paymentamount|value|paymentmethod|value|ccnum
> ber1|value|ccnumber2|value|ccnumber3|value|ccnumber4|value|cctype|value|ccexpira
> tion|value|cvccode|value|ccbillingzipcode|value|meal|value|wdsinvoice|value|regi
> strationdate|value|checkinstatus|value|confirmationsent|value"
> mm_columnsstr =
> "firstname|',none,''|lastname|',none,''|address|',none,''|city|',none,''|state|'
> ,none,''|zipcode|',none,''|phone|',none,''|fax|',none,''|email|',none,''|oetrack
> er|',none,''|license|',none,''|ceaccount|',none,''|eventname|',none,''|eventdate
> |',none,''|paymentamount|',none,''|paymentmethod|',none,''|ccnumber1|',none,''|c
> cnumber2|',none,''|ccnumber3|',none,''|ccnumber4|',none,''|cctype|',none,''|ccex
> piration|',none,''|cvccode|',none,''|ccbillingzipcode|',none,''|meal|',none,''|w
> dsinvoice|',none,''|registrationdate|',none,''|checkinstatus|',none,''|confirmat
> ionsent|',none,''"
>
> ' create mm_fields , mm_columns arrays
> mm_fields = split(mm_fieldsstr, "|")
> mm_columns = split(mm_columnsstr, "|")
>
> ' set form values
> mm_i = lbound(mm_fields) ubound(mm_fields) step 2
> mm_fields(mm_i+1) = cstr(request.form(mm_fields(mm_i)))
> next
>
> ' append query string redirect url
> if (mm_editredirecturl <> "" , request.querystring <> "")
> if (instr(1, mm_editredirecturl, "?", vbtextcompare) = 0 ,
> request.querystring <> "")
> mm_editredirecturl = mm_editredirecturl & "?" & request.querystring
> else
> mm_editredirecturl = mm_editredirecturl & "&" & request.querystring
> end if
> end if
>
> end if
> %>
>
> however, cs3 making code looks different
> code ive listed above. new code looks like:
>
> <%
> if (cstr(request("mm_insert")) = "seminarregistration")
> if (not mm_abortedit)
> ' execute insert
> dim mm_editcmd
>
> set mm_editcmd = server.createobject ("adodb.command")
> mm_editcmd.activeconnection = mm_seminardatabase_string
> mm_editcmd.commandtext = "insert seminarregistration (firstname,
> lastname, address, city, [state], zipcode, phone, fax, email, oetracker,
> license, ceaccount, eventname, eventdate, paymentamount, paymentmethod,
> ccnumber1, ccnumber2, ccnumber3, ccnumber4, cctype, ccexpiration, cvccode,
> ccbillingzipcode, meal, wdsinvoice, registrationdate, checkinstatus,
> confirmationsent) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
> ?, ?,
> ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"
> mm_editcmd.prepared = true
> mm_editcmd.parameters.append mm_editcmd.createparameter("param1", 202,
> 1,
> 50, request.form("firstname")) ' advarwchar
> mm_editcmd.parameters.append mm_editcmd.createparameter("param2", 202,
> 1,
> 50, request.form("lastname")) ' advarwchar
> mm_editcmd.parameters.append mm_editcmd.createparameter("param3", 202,
> 1,
> 50, request.form("address")) ' advarwchar
> mm_editcmd.parameters.append mm_editcmd.createparameter("param4", 202,
> 1,
> 50, request.form("city")) ' advarwchar
> mm_editcmd.execute
> mm_editcmd.activeconnection.close
>
> ' append query string redirect url
> dim mm_editredirecturl
> mm_editredirecturl = "registration_successful.htm"
> if (request.querystring <> "")
> if (instr(1, mm_editredirecturl, "?", vbtextcompare) = 0)
> 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
> %>
>
> problem comes when trying use new code
> (dreamweaver
> putting in default when creating pages alter
> mysql
> database inserting / updating / or deleting records via asp. web
> browsers
> report breaks @ " mm_editcmd.execute" section.
> why
> this? why dreamweaver using new formatting? there way can
> make
> use old way?
>
> help.
>
> -aaron
>
More discussions in Dreamweaver support forum
adobe
Comments
Post a Comment