473,231 Members | 1,375 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,231 software developers and data experts.

ASP - SQL problem

Hi Can someone please help!

I am having a problem with a form! I need to be able to
pull information from one table when the page loads and
update another table after I have made changes but the
second time the page loads I want to load the information
from the second table and not from the origional location.
How do I do something like this?
See the code below! I have added a whole load of comments!

Thanks for any help!
..: CODE :.

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<%'Submits the updated info to an asp update page%>
<script>
function changetax () {
document.forma.task.value = "CT";
document.forma.submit ();
</script>

<%
dim rs, tmprs, conn, sql
dim procid, tableid, symbol
dim task, menu, exrate, currname

set conn = server.createobject("adodb.connection")
conn.open (application("proc"))

procid = request("procid")
task = request("task")

sql = "select * from tblpurchase where procid = '" &
procid & "';"
set rs = conn.execute(sql)

sql = "select * from tblCurrency where CurrencyID = " & rs
("CurrencyID") & ";"
set tmprs = conn.execute(sql)
symbol = tmprs("CurrencySymbol")
exrate = tmprs("ExRate")
TaxAmount = tmprs("TaxAmt")
%>
</head>

<body>
<form name="forma" action="dosupplies.asp" method="post">

<font style="font-size:12pt;"><b>New item</b></font>
<table cellpadding=3 cellspacing=0 border=0>

<tr><td valign="top"><b>Description</b></td>
<td colspan=3><textarea name="description0" cols="50"
rows="2"></textarea></td>

</tr>

<tr>
<td valign="bottom"><b>Qty</b></td>
<td valign="bottom"><b>Unit type</b></td>
<td valign="bottom"><b>Cost</b></td>
<td valign="bottom" align="center"><b>(%)
<br>Discount</b></td>
</tr>

<tr><td><input name="quan0" value="1" size=4></td>
<td><select name="unit0">
<% while not alphars.eof %>
<option value="<%=alphars("unit")%>"><%=alphars
("unit")%>&nbsp;(<%=alphars("unitdesc")%>)
<% alphars.movenext
wend
alphars.movefirst
%></select></td>
<td><input name="unitcost0" value="0" size=10></td>
<td><input name="disc0" value="0" size=5></td>
<td colspan=1>
<input type="button" value="add this item"
onclick="javscript:newitem();">
<% if step > 0 then %>
<input type="button" value="Next (no more items)
" onclick="javascript:doit();"><br>
<% end if %>
</td>
</tr>

</table>

<!--- Current Added items --->

<hr>
<font style="font-size:12pt;"><b>Current line
items</b></font>
<% if not tmprs.eof then %>
<table cellpadding=3 cellspacing=0 border=0>

<% count = 0

while not tmprs.eof
count = count + 1
subtotal = tmprs("Quantity") * tmprs("UnitCost") %>

<tr><td valign="bottom"><b>#</b></td>
<td valign="bottom"><b>Qty</b></td>
<td valign="bottom"><b>Unit type</b></td>
<td valign="bottom"><b>Cost</b></td>
<td valign="bottom" align="center"><b>(%)
<br>Discount</b></td>
<td valign="bottom"
align="center"><b>Total<BR>Discount</b></td>
<td valign="bottom" align="center"><b>Tax</b></td>
<td valign="bottom" align="center"><b>Total</b></td>
</tr>

<tr><td><%=tmprs("itemno")%></td>
<td><input name="quan<%=count%>" value="<%=tmprs
("Quantity")%>" size=4></td>
<td><select name="unit<%=count%>">
<% while not alphars.eof %>
<option value="<%=alphars("unit")%>" <%if
alphars("unit")=tmprs("unit") then response.write
("SELECTED")%>><%=alphars("unit")%>&nbsp;(<%=alpha rs
("unitdesc")%>)
<% alphars.movenext
wend
alphars.movefirst

'Adds all unit costs together to provide a subtotal

Pdiscount=tmprs("Disc")
Tdiscount=formatnumber((subtotal) / 100 * Pdiscount)
Ttax=((subtotal-Tdiscount)/100) * TaxAmount
totalcost=(subtotal-Tdiscount)+Ttax
%>
</select>
</td>
<td><input name="unitcost<%=count%>" value="<%=tmprs
("UnitCost")%>" size=10></td>
<td><input name="disc<%=count%>" value="<%
=Pdiscount%>" size=5></td>
<td align="center"><%=Tdiscount%></td>
<td align="center"><%=Ttax%></td>
<td align="right"><b><%=formatnumber(totalcost)%</b></td> <td>
&nbsp;<input type="button" value="update"
onclick="javscript:updateitem(<%=count%>,<%=tmprs
("supplyid")%>);">
<input type="button" value="delete"
onclick="javscript:killitem(<%=count%>,<%=tmprs
("supplyid")%>,<%=tmprs("itemno")%>);">
</td>
</tr>

<tr><td colspan=2 valign="top"><b>Description</b></td>
<td colspan=4><textarea name="description<%=count%>"
cols="50" rows="2"><%=tmprs("Description")%</textarea></td>

</tr>

<% tmprs.movenext
wend
%>
</table>
<% else %>
<br>Currently there no line items.
<% end if %>

<%
'See below
'Tax Percentage allows the user to change the
'tax percentage to an alternative rather than the
'default taken from the table tblcurrencies, however when
'this is done it shouldn't change the value in the
'tblcurrencies table but rather in the tblpuchase.
'This is why the second time the page loads it sould no
'longer use the tblcurrencies table for it's information
'but rather the tblpurchase table.
%>

<hr>
<font style="font-size:12pt;"><b>Extra costs for this
procurement</b></font>
<table cellpadding=3 cellspacing=0 border=0>
<tr><td
valign="top"><b>Tax&nbsp;Percentage:</b>&nbsp;</td><td
valign="top">
<input name="taxamt" value="<%=TaxAmount%>" size=3>%
</td></tr>
<tr><td
valign="top"><b>Shipping&nbsp;Cost:</b>&nbsp;</td><td
valign="top">
<input name="ShipCost" value="<%=rs("ShipCost")%>"
size=12></td></tr>
<tr><td valign="top"><b>Surcharges:</b></td>&nbsp;<td
valign="top">
<input name="SurCharge" value="<%=rs("SurCharge")%>"
size=12></td></tr>
</tr>
<tr><td></td><td><input type="button" value="update costs
changes" onclick="javascript:changetax();">
</td></tr>

</table>
<% set tmprs = nothing %>
<% set alphars = nothing %>
</body>
</html>

Jul 19 '05 #1
10 2110
With all that unecessary html that you posted, your post is too long to
read. From what you wrote above the html, it appears that you're looking
for something like this. http://www.aspfaq.com/show.asp?id=2270 If not,
post back with only necessary html or code that you have that isn't working.

Ray at work

"MyaTiX" <an*******@discussions.microsoft.com> wrote in message
news:10*****************************@phx.gbl...
Hi Can someone please help!

I am having a problem with a form! I need to be able to
pull information from one table when the page loads and
update another table after I have made changes but the
second time the page loads I want to load the information
from the second table and not from the origional location.
How do I do something like this?

Jul 19 '05 #2
MyaTiX wrote:
Hi Can someone please help!

I am having a problem with a form! I need to be able to
pull information from one table when the page loads and
update another table after I have made changes but the
second time the page loads I want to load the information
from the second table and not from the origional location.


This sounds ridi^H^H^H^H very convoluted. Why not simply include a column in
your table to specify whether the data has been edited or not? Why store the
same data in two tables? I'm sorry if you answered these questions in the
mass of code you posted, but I simply do not have time to plow through this
thing to find the answers.

Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jul 19 '05 #3
Please do not multipost MyaTiX. This is definitely a database-related
question
so .asp.db was the perfect group in which to post it. Posting it here as
well did not increase your chances of getting an answer (most of us
subscribe to both groups). On the contrary, if somebody had taken his time
to answer it here, only to find that it was already resolved in the other
group, that person may have been annoyed enough to ignore any future posts
from you, thereby decreasing your chances of getting help in the future.

There are times when you will not be sure which group is most appropriate,
and you will want to post a question to both groups. In that situation, you
should use the cross-posting technique, rather than posting the same message
multiple times. To crosspost, put a semicolon-delimited* list of the
newsgroups to which you wish to post in the To: header of your post and post
it once. It, and any replies to it, will appear in all the newsgroups in
your list. So, if I reply in .asp.db, my reply will also appear here in
..asp.general.

* ... or whatever delimiter is recognized by your news client

Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jul 19 '05 #4
Bob Barrows wrote:
Please do not multipost MyaTiX. This is definitely a database-related

Oops - please ignore this. I was mistaken. I think I'll take a break from
the newsgroups toda ... yeah, right! :-)

Bob
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jul 19 '05 #5
You know I could swear I read this post about a week ago.

1) Stop using request("item") you'll have problems, specify the collection.
2) Be wary of SQL Injection. Bob has a good link to an explanation. I
think it's www.sqlsecurity.com or something like that. But essentially, you
have
procid=request("procid")
"select * from tblPurchase where procid=" & procid

now if I stick on a "?procid=1 or 1=1; delete from tblPurchase" to the end
of the url, I think I'd cause a little trouble.

3) don't use Select *, specify your column names.

4) Why are you using two tables? I'm sure you have your reasons. I've not
read enough of your code to figure out what you are doing, but what I'd do
is put a hidden field in your form, such as <input type=hidden
name="postback" value="true"> then when you set your SQL Select statement,
throw an if in there...such as,

if Request.Form("postback")="true" then
sSQL="SELECT columnA, columnB FROM Table2"
else
sSQL"SELECT columnA, columnB FROM Table1"
end if

"MyaTiX" <an*******@discussions.microsoft.com> wrote in message
news:10*****************************@phx.gbl...
Hi Can someone please help!

I am having a problem with a form! I need to be able to
pull information from one table when the page loads and
update another table after I have made changes but the
second time the page loads I want to load the information
from the second table and not from the origional location.
How do I do something like this?
See the code below! I have added a whole load of comments!

Thanks for any help!
.: CODE :.

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; u
charset=iso-8859-1">
<%'Submits the updated info to an asp update page%>
<script>
function changetax () {
document.forma.task.value = "CT";
document.forma.submit ();
</script>

<%
dim rs, tmprs, conn, sql
dim procid, tableid, symbol
dim task, menu, exrate, currname

set conn = server.createobject("adodb.connection")
conn.open (application("proc"))

procid = request("procid")
task = request("task")

sql = "select * from tblpurchase where procid = '" &
procid & "';"
set rs = conn.execute(sql)

sql = "select * from tblCurrency where CurrencyID = " & rs
("CurrencyID") & ";"
set tmprs = conn.execute(sql)
symbol = tmprs("CurrencySymbol")
exrate = tmprs("ExRate")
TaxAmount = tmprs("TaxAmt")
%>
</head>

<body>
<form name="forma" action="dosupplies.asp" method="post">

<font style="font-size:12pt;"><b>New item</b></font>
<table cellpadding=3 cellspacing=0 border=0>

<tr><td valign="top"><b>Description</b></td>
<td colspan=3><textarea name="description0" cols="50"
rows="2"></textarea></td>

</tr>

<tr>
<td valign="bottom"><b>Qty</b></td>
<td valign="bottom"><b>Unit type</b></td>
<td valign="bottom"><b>Cost</b></td>
<td valign="bottom" align="center"><b>(%)
<br>Discount</b></td>
</tr>

<tr><td><input name="quan0" value="1" size=4></td>
<td><select name="unit0">
<% while not alphars.eof %>
<option value="<%=alphars("unit")%>"><%=alphars
("unit")%>&nbsp;(<%=alphars("unitdesc")%>)
<% alphars.movenext
wend
alphars.movefirst
%></select></td>
<td><input name="unitcost0" value="0" size=10></td>
<td><input name="disc0" value="0" size=5></td>
<td colspan=1>
<input type="button" value="add this item"
onclick="javscript:newitem();">
<% if step > 0 then %>
<input type="button" value="Next (no more items)
" onclick="javascript:doit();"><br>

<% end if %>
</td>
</tr>

</table>

<!--- Current Added items --->

<hr>
<font style="font-size:12pt;"><b>Current line
items</b></font>
<% if not tmprs.eof then %>
<table cellpadding=3 cellspacing=0 border=0>

<% count = 0

while not tmprs.eof
count = count + 1
subtotal = tmprs("Quantity") * tmprs("UnitCost") %>

<tr><td valign="bottom"><b>#</b></td>
<td valign="bottom"><b>Qty</b></td>
<td valign="bottom"><b>Unit type</b></td>
<td valign="bottom"><b>Cost</b></td>
<td valign="bottom" align="center"><b>(%)
<br>Discount</b></td>
<td valign="bottom"
align="center"><b>Total<BR>Discount</b></td>
<td valign="bottom" align="center"><b>Tax</b></td>
<td valign="bottom" align="center"><b>Total</b></td>
</tr>

<tr><td><%=tmprs("itemno")%></td>
<td><input name="quan<%=count%>" value="<%=tmprs
("Quantity")%>" size=4></td>
<td><select name="unit<%=count%>">
<% while not alphars.eof %>
<option value="<%=alphars("unit")%>" <%if
alphars("unit")=tmprs("unit") then response.write
("SELECTED")%>><%=alphars("unit")%>&nbsp;(<%=alpha rs
("unitdesc")%>)
<% alphars.movenext
wend
alphars.movefirst

'Adds all unit costs together to provide a subtotal

Pdiscount=tmprs("Disc")
Tdiscount=formatnumber((subtotal) / 100 * Pdiscount)
Ttax=((subtotal-Tdiscount)/100) * TaxAmount
totalcost=(subtotal-Tdiscount)+Ttax
%>
</select>
</td>
<td><input name="unitcost<%=count%>" value="<%=tmprs
("UnitCost")%>" size=10></td>
<td><input name="disc<%=count%>" value="<%
=Pdiscount%>" size=5></td>
<td align="center"><%=Tdiscount%></td>
<td align="center"><%=Ttax%></td>
<td align="right"><b><%=formatnumber(totalcost)%
</b></td>

<td>
&nbsp;<input type="button" value="update"
onclick="javscript:updateitem(<%=count%>,<%=tmprs
("supplyid")%>);">
<input type="button" value="delete"
onclick="javscript:killitem(<%=count%>,<%=tmprs
("supplyid")%>,<%=tmprs("itemno")%>);">
</td>
</tr>

<tr><td colspan=2 valign="top"><b>Description</b></td>
<td colspan=4><textarea name="description<%=count%>"
cols="50" rows="2"><%=tmprs("Description")%
</textarea></td>

</tr>

<% tmprs.movenext
wend
%>
</table>
<% else %>
<br>Currently there no line items.
<% end if %>

<%
'See below
'Tax Percentage allows the user to change the
'tax percentage to an alternative rather than the
'default taken from the table tblcurrencies, however when
'this is done it shouldn't change the value in the
'tblcurrencies table but rather in the tblpuchase.
'This is why the second time the page loads it sould no
'longer use the tblcurrencies table for it's information
'but rather the tblpurchase table.
%>

<hr>
<font style="font-size:12pt;"><b>Extra costs for this
procurement</b></font>
<table cellpadding=3 cellspacing=0 border=0>
<tr><td
valign="top"><b>Tax&nbsp;Percentage:</b>&nbsp;</td><td
valign="top">
<input name="taxamt" value="<%=TaxAmount%>" size=3>%
</td></tr>
<tr><td
valign="top"><b>Shipping&nbsp;Cost:</b>&nbsp;</td><td
valign="top">
<input name="ShipCost" value="<%=rs("ShipCost")%>"
size=12></td></tr>
<tr><td valign="top"><b>Surcharges:</b></td>&nbsp;<td
valign="top">
<input name="SurCharge" value="<%=rs("SurCharge")%>"
size=12></td></tr>
</tr>
<tr><td></td><td><input type="button" value="update costs
changes" onclick="javascript:changetax();">
</td></tr>

</table>
<% set tmprs = nothing %>
<% set alphars = nothing %>
</body>
</html>

Jul 19 '05 #6
Hi,

Sorry didn't realise that would happen!

I have a form which is used for purchasing, the tax
amount is pulled from a table in the database called
tblcurrencies which is used as the default tax amount,
however in the for the user has the option of changing
the default tax amount to another value of there choise.

When the user clicks on update the tax amount is updated
in a table called tblpurchase by an update page called
doupdate.asp, this then sends you back to the page where
the user made the changes! However when you are sent back
to the first page the page uses the default tax amount
again. HOW do I stop it from using the default tax amount
after a user has entered an alternate tax amount???

EG:

..: Code :.
Page1.asp
<script>
function changetax () {
document.forma.task.value = "CT";
document.forma.submit ();
</script>
<%
sql = "select * from tblCurrency where CurrencyID = " & rs
("CurrencyID") & ";"
set tmprs = conn.execute(sql)
symbol = tmprs("CurrencySymbol")
exrate = tmprs("ExRate")
TaxAmount = tmprs("taxamt")
%>
<form name="forma" action="doupdate.asp" method="post">
<table cellpadding=3 cellspacing=0 border=0>
<tr><td
valign="top"><b>Tax&nbsp;Percentage:</b>&nbsp;</td><td
valign="top">
<input name="taxamt" value="<%=TaxAmount%>" size=3>%
</td></tr>
</tr>
</table>
<input type="button" value="update costs changes"
onclick="javascript:changetax();">
</form>

doupdate.asp
<%
select case task
case "CT"
taxamt = request("taxamt")
shipcost = request("shipcost")
surcharge = request("surcharge")
sql = "update tblpurchase set taxamt = " & taxamt
& ", " &_
"shipcost = " & shipcost & ", surcharge = " &
surcharge & " " &_
"where procid = '" & procid & "';"
set rs = conn.execute(sql)
if step > 0 then
relocate = "page1.asp"
end if
end select
%>

Jul 19 '05 #7
You'll have to select that value from the tblpurchase, if that's where
you're storing that value. Are you sure that you want to store the value in
the DB before the user has even completed the transaction anyway? How are
you identifying that tax value that you're storing as being associated with
that user? Are you using sessions? If so, you may want to just store that
tax value in a session variable or pass it in the querystring or something
along those lines.

Ray at work

"MyaTiX" <an*******@discussions.microsoft.com> wrote in message
news:0f****************************@phx.gbl...
Hi,

Sorry didn't realise that would happen!

I have a form which is used for purchasing, the tax
amount is pulled from a table in the database called
tblcurrencies which is used as the default tax amount,
however in the for the user has the option of changing
the default tax amount to another value of there choise.

When the user clicks on update the tax amount is updated
in a table called tblpurchase by an update page called
doupdate.asp, this then sends you back to the page where
the user made the changes! However when you are sent back
to the first page the page uses the default tax amount
again. HOW do I stop it from using the default tax amount
after a user has entered an alternate tax amount???

EG:

.: Code :.
Page1.asp
<script>
function changetax () {
document.forma.task.value = "CT";
document.forma.submit ();
</script>
<%
sql = "select * from tblCurrency where CurrencyID = " & rs
("CurrencyID") & ";"
set tmprs = conn.execute(sql)
symbol = tmprs("CurrencySymbol")
exrate = tmprs("ExRate")
TaxAmount = tmprs("taxamt")
%>
<form name="forma" action="doupdate.asp" method="post">
<table cellpadding=3 cellspacing=0 border=0>
<tr><td
valign="top"><b>Tax&nbsp;Percentage:</b>&nbsp;</td><td
valign="top">
<input name="taxamt" value="<%=TaxAmount%>" size=3>%
</td></tr>
</tr>
</table>
<input type="button" value="update costs changes"
onclick="javascript:changetax();">
</form>

doupdate.asp
<%
select case task
case "CT"
taxamt = request("taxamt")
shipcost = request("shipcost")
surcharge = request("surcharge")
sql = "update tblpurchase set taxamt = " & taxamt
& ", " &_
"shipcost = " & shipcost & ", surcharge = " &
surcharge & " " &_
"where procid = '" & procid & "';"
set rs = conn.execute(sql)
if step > 0 then
relocate = "page1.asp"
end if
end select
%>

Jul 19 '05 #8
MyaTiX wrote:
Hi,

Sorry didn't realise that would happen!

I have a form which is used for purchasing, the tax
amount is pulled from a table in the database called
tblcurrencies which is used as the default tax amount,
however in the for the user has the option of changing
the default tax amount to another value of there choise.

When the user clicks on update the tax amount is updated
in a table called tblpurchase by an update page called
doupdate.asp, this then sends you back to the page where
the user made the changes! However when you are sent back
to the first page the page uses the default tax amount
again. HOW do I stop it from using the default tax amount
after a user has entered an alternate tax amount???


What kiind of database is this? I know the subject says "SQL" but all kinds
of databases use SQL. Type and version, please.

What you need to do in Page1.asp is first check tblPurchase to see if it
has a value before getting the value from tblCurrencies. The exact method of
doing this depends on your type of database.You could simply run a separate
query but that would be inefficient since an extra trip to the database
would be required.

If you show us the table structures and how they are related, we could come
up with a single query to get what you want.

Bob Barrows

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jul 19 '05 #9
MyaTiX wrote:
It is an SQL Server 7 Database!

I tried using the solution TomB suggested but I can't
seem to get it to work!
if Request.form("postback")="true" then
sql = "select TaxAmt from tblPurchase where procid
= '" & procid & "';"
set Taxrs = conn.execute(sql)
TaxAmount = Taxrs("TaxAmt")
else
sql = "select * from tblCurrency where CurrencyID = " & rs
("CurrencyID") & ";"
set Currs = conn.execute(sql)
TaxAmount = Currs("TaxAmt")
end if

Here is the table structure of the database!

.:tblCurrency
PK currencyid
currencysymbol
exchangerate
taxamt

.:tblPurchase
PK procid
taxamt
currencyid
etc
etc


OK, good! Here is a query to get what you want (this assumes that the taxamt
column in tblPurchase is configured to allow NULL.):

Select
c.currencysymbol,
c.exchangerate,
COALESCE(p.taxamt, c.taxamt) As [taxamt]
FROM tblCurrency c LEFT JOIN tblPurchase p
ON c.currencyid = p.currencyid
WHERE c.currencyid = ....

I suggest that you encapsulate this in a stored procedure instead of using
dynamic sql

HTH,
Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jul 19 '05 #10
That's a much better explanation.
How about, in the doupdate.asp page, when you update the value in
tblPurchase, set a Session variable to the new tax amount. THen back on
Page1.asp do this...

if Session("TaxAmount")="" then
TaxAmount=tempRS("taxamt")
else
TaxAmount=Session("TaxAmount")
end if
"MyaTiX" <an*******@discussions.microsoft.com> wrote in message
news:0f****************************@phx.gbl...
Hi,

Sorry didn't realise that would happen!

I have a form which is used for purchasing, the tax
amount is pulled from a table in the database called
tblcurrencies which is used as the default tax amount,
however in the for the user has the option of changing
the default tax amount to another value of there choise.

When the user clicks on update the tax amount is updated
in a table called tblpurchase by an update page called
doupdate.asp, this then sends you back to the page where
the user made the changes! However when you are sent back
to the first page the page uses the default tax amount
again. HOW do I stop it from using the default tax amount
after a user has entered an alternate tax amount???

EG:

.: Code :.
Page1.asp
<script>
function changetax () {
document.forma.task.value = "CT";
document.forma.submit ();
</script>
<%
sql = "select * from tblCurrency where CurrencyID = " & rs
("CurrencyID") & ";"
set tmprs = conn.execute(sql)
symbol = tmprs("CurrencySymbol")
exrate = tmprs("ExRate")
TaxAmount = tmprs("taxamt")
%>
<form name="forma" action="doupdate.asp" method="post">
<table cellpadding=3 cellspacing=0 border=0>
<tr><td
valign="top"><b>Tax&nbsp;Percentage:</b>&nbsp;</td><td
valign="top">
<input name="taxamt" value="<%=TaxAmount%>" size=3>%
</td></tr>
</tr>
</table>
<input type="button" value="update costs changes"
onclick="javascript:changetax();">
</form>

doupdate.asp
<%
select case task
case "CT"
taxamt = request("taxamt")
shipcost = request("shipcost")
surcharge = request("surcharge")
sql = "update tblpurchase set taxamt = " & taxamt
& ", " &_
"shipcost = " & shipcost & ", surcharge = " &
surcharge & " " &_
"where procid = '" & procid & "';"
set rs = conn.execute(sql)
if step > 0 then
relocate = "page1.asp"
end if
end select
%>

Jul 19 '05 #11

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

Similar topics

11
by: Kostatus | last post by:
I have a virtual function in a base class, which is then overwritten by a function of the same name in a publically derived class. When I call the function using a pointer to the derived class...
117
by: Peter Olcott | last post by:
www.halting-problem.com
18
by: Ian Stanley | last post by:
Hi, Continuing my strcat segmentation fault posting- I have a problem which occurs when appending two sting literals using strcat. I have tried to fix it by writing my own function that does the...
28
by: Jon Davis | last post by:
If I have a class with a virtual method, and a child class that overrides the virtual method, and then I create an instance of the child class AS A base class... BaseClass bc = new ChildClass();...
6
by: Ammar | last post by:
Dear All, I'm facing a small problem. I have a portal web site, that contains articles, for each article, the end user can send a comment about the article. The problem is: I the comment length...
16
by: Dany | last post by:
Our web service was working fine until we installed .net Framework 1.1 service pack 1. Uninstalling SP1 is not an option because our largest customer says service packs marked as "critical" by...
2
by: Mike Collins | last post by:
I cannot get the correct drop down list value from a drop down I have on my web form. I get the initial value that was loaded in the list. It was asked by someone else what the autopostback was...
0
by: =?Utf-8?B?am8uZWw=?= | last post by:
Hello All, I am developing an Input Methop (IM) for PocketPC / Windows Mobile (PPC/WM). On some devices the IM will not start. The IM appears in the IM-List but when it is selected from the...
1
by: sherifbk | last post by:
Problem description ============== - I have 4 clients and 1 server (SQL server) - 3 clients are Monitoring console 1 client is operation console - Monitoring console collects some data from...
9
by: AceKnocks | last post by:
I am working on a framework design problem in which I have to design a C++ based framework capable of solving three puzzles for now but actually it should work with a general puzzle of any kind and I...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

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.