HighDots Forums  

ASP/VB problem

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss ASP/VB problem in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
ConorS
 
Posts: n/a

Default ASP/VB problem - 09-01-2004 , 05:52 AM






Using asp/vb. I have the following problem. I don't know the asp/vb syntax that
well. I was wondering if you could help
me.

I have the following among my html code:

<TD>
<%=(Recordset1.Fields.Item("Var 1").Value)%>
<%=(Recordset1.Fields.Item("Var 2").Value)%>
</TD>

These are grabbing values from my database.
I want to create a new variable not in the database Called "VALUE". Value is
created by "Var 1" minus "Var 2".

How do i display "Value"?

I'm sure this isn't correct but i'd imagine its something like the following:

<%
Dim Value
Value = Recordset1.Fields.Item("Var 1").Value - Recordset1.Fields.Item("Var
2").Value
Display Value
%>

Thanx i appreciate it


Reply With Quote
  #2  
Old   
ConorS
 
Posts: n/a

Default Re: ASP/VB problem - 09-01-2004 , 05:58 AM






No problem i just figured it out

Reply With Quote
  #3  
Old   
Durwood Edwards
 
Posts: n/a

Default Re: ASP/VB problem - 09-01-2004 , 09:29 AM



If you tell us what youdid, maybe you will help a few others wanting to do
the same thing.
Thanks,
Durwood
"ConorS" <webforumsuser (AT) macromedia (DOT) com> wrote

Quote:
No problem i just figured it out



Reply With Quote
  #4  
Old   
RobGT
 
Posts: n/a

Default Re: ASP/VB problem - 09-01-2004 , 12:25 PM



Solution:

<%
Dim varValue
varValue = (Recordset1.Fields.Item("Var 1").Value -
Recordset1.Fields.Item("Var 2").Value)
Response.Write(varValue)
%>

Note:
I prepend "var" to my variable names to (mostly) avoid potential naming
conflicts...

HTH
Rob http://robgt.com/
Extensions: http://robgt.com/products/index.asp
Tutorials: http://robgt.com/tutorials/index.asp
Blog: http://blog.robgt.com/



Reply With Quote
Reply




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.