Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Working with an array

Reply
Thread Tools

Working with an array

 
 
Steve
Guest
Posts: n/a
 
      08-24-2008
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.Count > 0 then
if request.form("FormCouponCode") <> "" then
formCpnCode = trim(request.form("FormCouponCode"))
for i = 0 to 32
formCpnCode = replace(formCpnCode,chr(i),"")
next
codeArray = split(formCpnCode,",")
codeArrayCount = uBound(codeArray)

for i = 0 to codeArrayCount
item = codeArray(i)
sql = "SELECT bucksID, bcksNo, bcksOrderID, bcksValue,
bcksActive, bcksCpType FROM bobBucks WHERE bcksNo='" & item & "' and
(bcksActive='yes' or bcksActive='Yes')"
Set rst = Server.CreateObject("ADODB.RecordSet")
rst.Open sql, cnn
if rst.eof then
isCouponGood="no"
bckValue=0
else
isCouponGood=rst("bcksActive")
bckValue=rst("bcksValue")
end if
dim rSql,rst1
Set rst1 = Server.CreateObject("ADODB.RecordSet")
rSql = "Select * FROM sfTmpOrdersAE"
rst1.Open rSql, cnn, adOpenStatic, adLockOptimistic
rst1.AddNew
rst1("odrtmpSessionId") = Session("SessionID")
rst1("odrtmpCouponCode") = item
rst1("odrtmpIsActive") = isCouponGood
rst1("odrtmpValue") = bckValue
rst1.update

next
end if
end if

Steve


 
Reply With Quote
 
 
 
 
Old Pedant
Guest
Posts: n/a
 
      08-24-2008


"Steve" wrote:

> Not certain this is the correct newsgroup to post this,


It is.

But it's not nice to post the same question multiple places. Means that you
might cause several people to take the time to give you the same answers.

At a minimum, you should mention that you have posted in the other forum(s).

Anyway, I answered you here:
http://www.aspmessageboard.com/forum...98572&F=20&P=1


 
Reply With Quote
 
 
 
 
Steve
Guest
Posts: n/a
 
      08-24-2008
I did not realize the two forums were so closely associated with each
other...normally, I do not post at multiple forums, especially microsoft
ones, but in this case I did not think anyone was going to reply at the asp
message board....I do apologize if that has offended you or anyone else
here.

Steve

"Old Pedant" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
>
> "Steve" wrote:
>
>> Not certain this is the correct newsgroup to post this,

>
> It is.
>
> But it's not nice to post the same question multiple places. Means that
> you
> might cause several people to take the time to give you the same answers.
>
> At a minimum, you should mention that you have posted in the other
> forum(s).
>
> Anyway, I answered you here:
> http://www.aspmessageboard.com/forum...98572&F=20&P=1
>
>



 
Reply With Quote
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      08-24-2008
no harm, no foul.

If I _had_ wasted time composing a reply, that would have been a different
story
Steve wrote:
> I did not realize the two forums were so closely associated with each
> other...normally, I do not post at multiple forums, especially
> microsoft ones, but in this case I did not think anyone was going to
> reply at the asp message board....I do apologize if that has offended
> you or anyone else here.
>
> Steve
>
> "Old Pedant" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>>
>>
>> "Steve" wrote:
>>
>>> Not certain this is the correct newsgroup to post this,

>>
>> It is.
>>
>> But it's not nice to post the same question multiple places. Means
>> that you
>> might cause several people to take the time to give you the same
>> answers. At a minimum, you should mention that you have posted in the
>> other
>> forum(s).
>>
>> Anyway, I answered you here:
>> http://www.aspmessageboard.com/forum...98572&F=20&P=1


--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


 
Reply With Quote
 
Old Pedant
Guest
Posts: n/a
 
      08-24-2008


"Steve" wrote:

> I do apologize if that has offended you or anyone else here.


No offense taken, at all. Didn't mean to imply any. And no, the forums
aren't closely linked; I think only a handful of us see both. But, still,
it's just good netiquette to say you are posting multiple places, so somebody
can check to see that your question has already been answered, if they want
to, to avoid repetition of work.

Anyway, if I came on too strong, I apologize.


 
Reply With Quote
 
Old Pedant
Guest
Posts: n/a
 
      08-25-2008
"Steve" wrote:
> 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.


If anyone cares... The problem had nothing to do with array usage. Steve had
<input type=submit onclick="this.form.submit( );" ...>
and so of course the HTML was submitting the form twice.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
const and array of array (of array ...) Mara Guida C Programming 3 09-03-2009 07:54 AM
wifi not working on new hp, or not working after live update =?Utf-8?B?RHJhZ29ueA==?= Wireless Networking 1 10-01-2005 11:17 PM
length of an array in a struct in an array of structs in a struct in an array of structs Tuan Bui Perl Misc 14 07-29-2005 02:39 PM
Length of Array of Array of Array Tom Perl Misc 3 12-20-2004 05:23 PM
Regular Expression validators NOT working, Required Field validators ARE working Ratman ASP .Net 0 09-14-2004 09:36 PM



Advertisments