Home | Advertising Info2 USERS CURRENTLY ONLINE   
PowerASP
   Site Search Contact Us Friday, May 10, 2024  

  Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
Classic ASP - General
 PowerASP Code Help Area : Classic ASP - General
Subject Topic: Help increasing a database by x value Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
whega
Newbie
Newbie


Joined: November/27/2006
Online Status: Offline
Posts: 3
Posted: November/27/2006 at 10:38pm | IP Logged Quote whega

Hi All,

I have the following statement in an asp page:

Att_New = Current.Fields.Item("attempts").Value + 1

The above statement will work fine. However, what i actually need is for + 1 to be a value to be acquired from the form. The data is collected from the form with the line below:

insert_attempts = Request.Form("Attempts")

Does anyone know how to code this line to that Att_New = current database value + new value acquired from the form.

Any help is appreciated. Thank you.

 

Back to Top View whega's Profile Search for other posts by whega
 
firas_TheGeek
Newbie
Newbie
Avatar

Joined: May/27/2006
Location: Oman
Online Status: Offline
Posts: 28
Posted: November/28/2006 at 5:17am | IP Logged Quote firas_TheGeek

Hi,

 

Could you please explain better. Cause im not sure i got what you are talking about.

 

 

Best Regards

Firas S Assaad



__________________
Firas S Assaad (TheGeek)
firas489@gmail.com
0096892166434
http://firas-thegeek.blogspot.com
Back to Top View firas_TheGeek's Profile Search for other posts by firas_TheGeek Visit firas_TheGeek's Homepage
 
whega
Newbie
Newbie


Joined: November/27/2006
Online Status: Offline
Posts: 3
Posted: November/28/2006 at 2:27pm | IP Logged Quote whega

Thanks for the response,

What I am trying to do is add the value submitted via the form to the value currently in the database.

For example, in the database, I have a field called attempts and the current value of this field is 10. I then have a form to update this field. If some selects 10 on the form and submits it, i want to add the both values together to that i can update the database with this new total.

Hope this explained it a little better

Back to Top View whega's Profile Search for other posts by whega
 
whega
Newbie
Newbie


Joined: November/27/2006
Online Status: Offline
Posts: 3
Posted: November/28/2006 at 5:30pm | IP Logged Quote whega

Got this fixed. I just added another field in the table to hold the value from the form. I was then able to use the following command

Att_New = Current.Fields.Item("attempts").Value + Current.Fields.Item("temp_att").Value

 

And this worked just fine. Probably not the best way to do business but it works.

Thanks all

Back to Top View whega's Profile Search for other posts by whega
 
firas_TheGeek
Newbie
Newbie
Avatar

Joined: May/27/2006
Location: Oman
Online Status: Offline
Posts: 28
Posted: November/28/2006 at 11:32pm | IP Logged Quote firas_TheGeek

Hi,

Just to make that i understood you 100%

If there is a field in the database that has the value of 10 and a user submits a value of 5 in order to add this value with the value in the field in the database, then after submitting that field will end up to have the value of 15 right??

if yes, then i dont think what you did in the last post works

use this instead:

Current.Fields.Item("attempts").Value = Current.Fields.Item("attempts").Value + request("THE_FIELD_NAME_IN_THE_FORM_THE_USER_WOULD_SUBMIT")

 

 

Hope this help.

If not, please let me know.

 

 

Best Regards

Firas S Assaad



__________________
Firas S Assaad (TheGeek)
firas489@gmail.com
0096892166434
http://firas-thegeek.blogspot.com
Back to Top View firas_TheGeek's Profile Search for other posts by firas_TheGeek Visit firas_TheGeek's Homepage
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum

   Active Server Pages Rule The World
Contact Us  
All artwork, design & content contained in this site are Copyright © 1998 - 2024 PowerASP.com and Christopher J. Williams
Banner ads ,other site logos, etc are copyright of their respective companies.
STATS Unless otherwise noted - All Rights Reserved.

PowerASP active server pages asp.net microsoft .net framework sdk learn asp what is asp tutorial learn asp.net CJWSoft ASPProtect ASPBanner ASPClassifieds www.aspprotect.com, www.cjwsoft.com,www.aspclassifieds.com,www.aspphotogallery.com