473,386 Members | 1,652 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Working with an array

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
Aug 24 '08 #1
5 1392


"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
Aug 24 '08 #2
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" <Ol*******@discussions.microsoft.comwrote in message
news:37**********************************@microsof t.com...
>

"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


Aug 24 '08 #3
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" <Ol*******@discussions.microsoft.comwrote in message
news:37**********************************@microsof t.com...
>>

"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"
Aug 24 '08 #4


"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.
Aug 24 '08 #5
"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.
Aug 25 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Amy Kimber | last post by:
Hello, I have a file upload page, and I've had it working fine, it was beautiful :-) Anyway, the powers that be moved hosts... and it doesn't work now. The file name is correct, the directory...
12
by: Treetop | last post by:
I cannot get this array to work. I want to have the game listed until the day after the event, then come off the list. function events() { var today = new Date(); var dayarray=new...
11
by: Al | last post by:
This statement returns a -1, indicating "not found": Find1 = Array.IndexOf(FilesArray, "sa001") But IndexOf on a specific item in that array returns a value of 26: Find1 =...
10
by: alanbe | last post by:
I am working on some scripts to help me automate the website creation process. I want to use a template for the whole website and call pages using something like ...
2
by: Daz | last post by:
Hi everyone. I am having a problem with array_search(). My php script gets a list of books from the database, and then compares them with a list of books which have been obtained from a textarea in...
5
by: =?ISO-8859-1?Q?Jonathan_Gro=DF?= | last post by:
Hi everybody, in the sample below my programm gives a "Bus error" on the marked line. I don't get it why that happens. I followed the instructions in the C-FAQ. #include <math.h> #include...
2
by: irish10945 | last post by:
I have been using this great dynamic page flip from 76 design but I've run into some problems maybe someone can help me out with. I have about 70 pages in the book. I do not want people to have to...
5
by: Neil | last post by:
"lyle" <lyle.fairfield@gmail.comwrote in message news:48c3dde7-07bd-48b8-91c3-e157b703f92b@f3g2000hsg.googlegroups.com... Question for you. I'm doing something similar, only, instead of opening...
0
by: Omer | last post by:
I am trying to create a shared addin using visual studio 2005 with the following code. It is working only in Power Point Appliction and not loading in Excel and Word I used the Visual Studio Wizard...
61
by: bonneylake | last post by:
Hey Everyone, Well after asking many questions i have this almost working. This is how it works. Basically i fill in my customer number field an that populates my drop down box. Once i select...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.