Not certain this is the correct newsgroup to post this, but I hope someone
here can help me. I am creating an array from a form field, parsing it, then
posting the data to a database using classic ASP. The problem I am
encountering is that the data is doubling up when posting. For example, if
there is only one item in the array, it will post twice. Below is the code I
am using: If anyone could be of any assistance, I sure would appreciate
it....
if Request.Form.Co unt 0 then
if request.form("F ormCouponCode") <"" then
formCpnCode = trim(request.fo rm("FormCouponC ode"))
for i = 0 to 32
formCpnCode = replace(formCpn Code,chr(i),"")
next
codeArray = split(formCpnCo de,",")
codeArrayCount = uBound(codeArra y)
for i = 0 to codeArrayCount
item = codeArray(i)
sql = "SELECT bucksID, bcksNo, bcksOrderID, bcksValue,
bcksActive, bcksCpType FROM bobBucks WHERE bcksNo='" & item & "' and
(bcksActive='ye s' or bcksActive='Yes ')"
Set rst = Server.CreateOb ject("ADODB.Rec ordSet")
rst.Open sql, cnn
if rst.eof then
isCouponGood="n o"
bckValue=0
else
isCouponGood=rs t("bcksActive ")
bckValue=rst("b cksValue")
end if
dim rSql,rst1
Set rst1 = Server.CreateOb ject("ADODB.Rec ordSet")
rSql = "Select * FROM sfTmpOrdersAE"
rst1.Open rSql, cnn, adOpenStatic, adLockOptimisti c
rst1.AddNew
rst1("odrtmpSes sionId") = Session("Sessio nID")
rst1("odrtmpCou ponCode") = item
rst1("odrtmpIsA ctive") = isCouponGood
rst1("odrtmpVal ue") = bckValue
rst1.update
next
end if
end if
Steve
here can help me. I am creating an array from a form field, parsing it, then
posting the data to a database using classic ASP. The problem I am
encountering is that the data is doubling up when posting. For example, if
there is only one item in the array, it will post twice. Below is the code I
am using: If anyone could be of any assistance, I sure would appreciate
it....
if Request.Form.Co unt 0 then
if request.form("F ormCouponCode") <"" then
formCpnCode = trim(request.fo rm("FormCouponC ode"))
for i = 0 to 32
formCpnCode = replace(formCpn Code,chr(i),"")
next
codeArray = split(formCpnCo de,",")
codeArrayCount = uBound(codeArra y)
for i = 0 to codeArrayCount
item = codeArray(i)
sql = "SELECT bucksID, bcksNo, bcksOrderID, bcksValue,
bcksActive, bcksCpType FROM bobBucks WHERE bcksNo='" & item & "' and
(bcksActive='ye s' or bcksActive='Yes ')"
Set rst = Server.CreateOb ject("ADODB.Rec ordSet")
rst.Open sql, cnn
if rst.eof then
isCouponGood="n o"
bckValue=0
else
isCouponGood=rs t("bcksActive ")
bckValue=rst("b cksValue")
end if
dim rSql,rst1
Set rst1 = Server.CreateOb ject("ADODB.Rec ordSet")
rSql = "Select * FROM sfTmpOrdersAE"
rst1.Open rSql, cnn, adOpenStatic, adLockOptimisti c
rst1.AddNew
rst1("odrtmpSes sionId") = Session("Sessio nID")
rst1("odrtmpCou ponCode") = item
rst1("odrtmpIsA ctive") = isCouponGood
rst1("odrtmpVal ue") = bckValue
rst1.update
next
end if
end if
Steve
Comment