Hello!
Here is what i am doing. I have this database and i need
to grab some info out of it, multiply it, than select it
and print it out. It is not printing out the info. Anyone
got any ideas?
Thanks!
<%
Response.Expire s = -1000 'Make sure the browser doesnt
cache this page
Response.Buffer = True 'enables our response.redire ct to
work
If Request.Form("v aluepassed") ="true" Then
CheckLoginForm
Else
ShowLoginForm
End If
Sub CheckLoginForm
Dim myconn, myconn2, myconn3, strsales, strorders
**(didnt include the connection strings in here as they
work)**
myconn.execute( "UPDATE orders SET sales = (orders *
29.99) , lastlogged = '" & Now() & "' WHERE company='"
& "abc" & "';")
strorders = myconn2.execute ("SELECT orders FROM orders
WHERE company='" & "abc" & "';")
strsales = myconn3.execute ("SELECT orders FROM orders
WHERE company='" & "abc" & "';")
End Sub
%>
<% Sub ShowLoginForm %>
<table width="100%" border="0" cellspacing="0"
cellpadding="0" >
<tr>
<td><div align="center"> <strong><font color="#0000FF"
size="5" face="Verdana, Arial, Helvetica, sans-
serif">Report</font></strong></div></td>
</tr>
<tr>
<td><p> </p>
<p><font size="2" face="Verdana, Arial, Helvetica, sans-
serif">Welcome Back!</font></p>
<form name="calculati ons" action="report. asp"
method="post">
<table width="100%" cellspacing="0" cellpadding="0" >
<tr>
<td width="24%" height="21"><st rong><font size="2"
face="Verdana, Arial, Helvetica, sans-serif">Gross
Orders</font></strong></td>
<td width="76%"><st rong><font size="2" face="Verdana,
Arial, Helvetica, sans-serif">Gross
Sales</font></strong></td>
</tr>
tr>
<td>
<% Response.Write( strorders) %>
</td>
<td>
<% Response.Write( strsales) %>
</td>
</tr>
</table>
</form><p> </p>
<p> </p></td>
</tr>
</table>
<% End Sub %> 6 1595
Where do you define / open myconn, myconn2, myconn3? Why do you think you
need three connection objects to query one database? Why are you doing this
in a subroutine? What is the difference between strorders and strsales?
Why do you think you can just response.write an object?
"Help Please" <no****@heh.com > wrote in message
news:1f******** *************** *****@phx.gbl.. . Hello!
Here is what i am doing. I have this database and i need to grab some info out of it, multiply it, than select it and print it out. It is not printing out the info. Anyone got any ideas?
Thanks!
<% Response.Expire s = -1000 'Make sure the browser doesnt cache this page Response.Buffer = True 'enables our response.redire ct to work
If Request.Form("v aluepassed") ="true" Then CheckLoginForm Else ShowLoginForm End If
Sub CheckLoginForm Dim myconn, myconn2, myconn3, strsales, strorders **(didnt include the connection strings in here as they work)**
myconn.execute( "UPDATE orders SET sales = (orders * 29.99) , lastlogged = '" & Now() & "' WHERE company='" & "abc" & "';")
strorders = myconn2.execute ("SELECT orders FROM orders WHERE company='" & "abc" & "';") strsales = myconn3.execute ("SELECT orders FROM orders WHERE company='" & "abc" & "';")
End Sub %>
<% Sub ShowLoginForm %> <table width="100%" border="0" cellspacing="0" cellpadding="0" > <tr> <td><div align="center"> <strong><font color="#0000FF" size="5" face="Verdana, Arial, Helvetica, sans- serif">Report</font></strong></div></td> </tr> <tr> <td><p> </p> <p><font size="2" face="Verdana, Arial, Helvetica, sans- serif">Welcome Back!</font></p> <form name="calculati ons" action="report. asp" method="post"> <table width="100%" cellspacing="0" cellpadding="0" > <tr> <td width="24%" height="21"><st rong><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Gross Orders</font></strong></td> <td width="76%"><st rong><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Gross Sales</font></strong></td> </tr> tr> <td>
<% Response.Write( strorders) %>
</td> <td>
<% Response.Write( strsales) %> </td>
</tr> </table> </form><p> </p> <p> </p></td> </tr> </table> <% End Sub %>
For starters, myconn2.execute ("SELECT orders FROM orders
WHERE company='" & "abc" & "';") and
myconn3.execute ("SELECT orders FROM orders
WHERE company='" & "abc" & "';")
won't return strings. Set these values to recordsets.
Secondly strsales and strorders are declared in a CheckLoginForm and are not
available to ShowLoginForm.
Finally, you don't need 3 connections, use one.
Have a search through google or MSDN for recordsets etc in ASP.
"Help Please" <no****@heh.com > wrote in message
news:1f******** *************** *****@phx.gbl.. . Hello!
Here is what i am doing. I have this database and i need to grab some info out of it, multiply it, than select it and print it out. It is not printing out the info. Anyone got any ideas?
Thanks!
<% Response.Expire s = -1000 'Make sure the browser doesnt cache this page Response.Buffer = True 'enables our response.redire ct to work
If Request.Form("v aluepassed") ="true" Then CheckLoginForm Else ShowLoginForm End If
Sub CheckLoginForm Dim myconn, myconn2, myconn3, strsales, strorders **(didnt include the connection strings in here as they work)**
myconn.execute( "UPDATE orders SET sales = (orders * 29.99) , lastlogged = '" & Now() & "' WHERE company='" & "abc" & "';")
strorders = myconn2.execute ("SELECT orders FROM orders WHERE company='" & "abc" & "';") strsales = myconn3.execute ("SELECT orders FROM orders WHERE company='" & "abc" & "';")
End Sub %>
<% Sub ShowLoginForm %> <table width="100%" border="0" cellspacing="0" cellpadding="0" > <tr> <td><div align="center"> <strong><font color="#0000FF" size="5" face="Verdana, Arial, Helvetica, sans- serif">Report</font></strong></div></td> </tr> <tr> <td><p> </p> <p><font size="2" face="Verdana, Arial, Helvetica, sans- serif">Welcome Back!</font></p> <form name="calculati ons" action="report. asp" method="post"> <table width="100%" cellspacing="0" cellpadding="0" > <tr> <td width="24%" height="21"><st rong><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Gross Orders</font></strong></td> <td width="76%"><st rong><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Gross Sales</font></strong></td> </tr> tr> <td>
<% Response.Write( strorders) %>
</td> <td>
<% Response.Write( strsales) %> </td>
</tr> </table> </form><p> </p> <p> </p></td> </tr> </table> <% End Sub %>
I skipped defining the myconn connection strings becuase
it was pointless ot put them in here since they work.
strorders is the amount of orders taken
strsales is the number of orders multiplyed by a price.
Strsales and orders are variables not objects, unless i
am wrong, so i thought i could display a variable. -----Original Message----- Where do you define / open myconn, myconn2, myconn3?
Why do you think youneed three connection objects to query one database?
Why are you doing thisin a subroutine? What is the difference between
strorders and strsales?Why do you think you can just response.write an object?
"Help Please" <no****@heh.com > wrote in message news:1f******* *************** ******@phx.gbl. .. Hello!
Here is what i am doing. I have this database and i
need to grab some info out of it, multiply it, than select
it and print it out. It is not printing out the info.
Anyone got any ideas?
Thanks!
<% Response.Expire s = -1000 'Make sure the browser doesnt cache this page Response.Buffer = True 'enables our response.redire ct
to work
If Request.Form("v aluepassed") ="true" Then CheckLoginForm Else ShowLoginForm End If
Sub CheckLoginForm Dim myconn, myconn2, myconn3, strsales, strorders **(didnt include the connection strings in here as they work)**
myconn.execute( "UPDATE orders SET sales = (orders * 29.99) , lastlogged = '" & Now() & "' WHERE company='" & "abc" & "';")
strorders = myconn2.execute ("SELECT orders FROM orders WHERE company='" & "abc" & "';") strsales = myconn3.execute ("SELECT orders FROM orders WHERE company='" & "abc" & "';")
End Sub %>
<% Sub ShowLoginForm %> <table width="100%" border="0" cellspacing="0" cellpadding="0" > <tr> <td><div align="center"> <strong><font color="#0000FF" size="5" face="Verdana, Arial, Helvetica, sans- serif">Report</font></strong></div></td> </tr> <tr> <td><p> </p> <p><font size="2" face="Verdana, Arial, Helvetica,
sans- serif">Welcome Back!</font></p> <form name="calculati ons" action="report. asp" method="post"> <table width="100%" cellspacing="0" cellpadding="0" > <tr> <td width="24%" height="21"><st rong><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Gross Orders</font></strong></td> <td width="76%"><st rong><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Gross Sales</font></strong></td> </tr> tr> <td>
<% Response.Write( strorders) %>
</td> <td>
<% Response.Write( strsales) %> </td>
</tr> </table> </form><p> </p> <p> </p></td> </tr> </table> <% End Sub %>
.
> Strsales and orders are variables not objects, unless i am wrong,
No, they are recordset objects.
Sorry i am using a SQL 2000 Server heh -----Original Message----- Function Orders Dim myconn, myconn2, strorders Set myconn = Server.CreateOb ject("ADODB.Con nection") Set myconn2 = Server.CreateOb ject("ADODB.Con nection")
myconn.execute ("UPDATE xxx set sales = (orders *
29.99) ,lastlogged = '" & Now() & "' WHERE company='" & "abc" & "';")
set strorders = myconn2.execute ("SELECT orders FROM xxx WHERE company='" & "abc" & "';") End Function
Function Sales Dim myconn3, strsales Set myconn3 = Server.CreateOb ject("ADODB.Con nection")
set strsales = myconn3.execute ("SELECT orders FROM xxx WHERE company='" & "abc" & "';") End Function
<td><% Response.Write Orders() % </td> <td><% Response.Write Sales() %></td>
Still aint working like this.
-----Original Message----- Hello!
Here is what i am doing. I have this database and i
needto grab some info out of it, multiply it, than select
itand print it out. It is not printing out the info. Anyonegot any ideas?
Thanks!
<% Response.Expi res = -1000 'Make sure the browser doesnt cache this page Response.Buff er = True 'enables our response.redire ct
towork
If Request.Form("v aluepassed") ="true" Then CheckLoginFor m Else ShowLoginFo rm End If
Sub CheckLoginForm Dim myconn, myconn2, myconn3, strsales, strorders **(didnt include the connection strings in here as they work)**
myconn.execut e("UPDATE orders SET sales = (orders * 29.99) , lastlogged = '" & Now() & "' WHERE company='" & "abc" & "';")
strorders = myconn2.execute ("SELECT orders FROM orders WHERE company='" & "abc" & "';") strsales = myconn3.execute ("SELECT orders FROM orders WHERE company='" & "abc" & "';")
End Sub %>
<% Sub ShowLoginForm %> <table width="100%" border="0" cellspacing="0" cellpadding=" 0"> <tr> <td><div align="center"> <strong><font color="#0000FF" size="5" face="Verdana, Arial, Helvetica, sans- serif">Report </font></strong></div></td> </tr> <tr> <td><p> </p> <p><font size="2" face="Verdana, Arial, Helvetica, sans- serif">Welcom e Back!</font></p> <form name="calculati ons" action="report. asp" method="post" > <table width="100%" cellspacing="0" cellpadding="0" > <tr> <td width="24%" height="21"><st rong><font size="2" face="Verdana , Arial, Helvetica, sans-serif">Gross Orders</font></strong></td> <td width="76%"><st rong><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Gross Sales</font></strong></td> </tr> tr> <td>
<% Response.Write( strorders) %>
</td> <td>
<% Response.Write( strsales) %> </td>
</tr> </table> </form><p> </p> <p> </p></td> </tr> </table> <% End Sub %>
. .
Why do you change your name every time you post? Can you stop, so we don't
get dizzy trying to figure out who is who?
"Server" <ty**@nospam.co m> wrote in message
news:15******** *************** *****@phx.gbl.. . Sorry i am using a SQL 2000 Server heh This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Michael Qiu |
last post by:
I hava a select component on my form. the width of the select component is fixed,so if the length of the option's shown string larger than the select component's width,how can i make the shown string wrap to next line?
<select name=123 style="width:100px;height:200px">
<option value=1>abcdefghijklmnopqrstuvwxyz</option>
</select>
select...
|
by: Amish |
last post by:
Hi,
I have CSS based popup menus which display over a select list.
Everything works fine with Mozilla and Firefox but in IE the select list
is always on top of the display block. The z-index as no effect in IE.
This behaviour is confirmed by
http://www.blooberry.com/indexdot/css/properties/position/zindex.htm
The HTML listing below shows...
|
by: Joachim Bauer |
last post by:
I'm using the code below to display a menu that opens when the mouse
goes over the main menu item (try it in your browser to understand the
behaviour).
It uses "position:absolute" and a switch between "display='none'" and
"display=''".
However the problem is that
- in Internet Explorer 6 the dropdown (<select>...) always hides the
menu
|
by: d.schulz81 |
last post by:
Hi all
how can i manipulate a multiple select into a single select dropdown
field with JavaScript?
thanks
|
by: Jos? |
last post by:
This one droves me completely mad. I did not succeed to exploit the
track given to me by Bob.
I have :
three tables : Clubs, Persons and ClubsPersons that join the two first
in a many to many relationship.
Club has two (2) fields : ClubId (Autonumber) and ClubName (Text).
Peoples has two(2) fields : (PersonId (Autonumber) and PersonName...
| |
by: hamil |
last post by:
I have a graphic file demo program that almost works. My form has a
PageSetupDialog, PrintPreview, PrintDialog, and a PrintDocument control.
Sample code follows.
Now here is the quesion. When I open the PrintDialog control, there is a
dropdown to select a printer from the list of available printers. However,
the PageSetupDialog sets the...
|
by: gregincolumbus |
last post by:
I am trying to get the financial calculation on this to trigger whenever there is a change to select1. Right now, the user has to click on select2 to trigger the changes.
Ideally, a change of select1
1. trigger the population of select2 (and set it initially to 0)
2. make the text fields disappear
3. trigger the financial calculation...
|
by: runway27 |
last post by:
hi
i have registration form where user selects from a drop down to select their area code apart from filling other details in the form. in the next page which is a confirmation page i would like to display the select option that a user choose in the first page i am able to display this using a textfield however i would like to display using the...
|
by: FlashCreations |
last post by:
Hello,
I am trying to use javascript to validate a form that has three select inputs. Here is the form:
<form name="select" action="main.php" method="post" onsubmit="return ValidateSelect(this)">
<select name="one">
<option value="0" selected="selected">-Select An Option-</option>
</select>
<select name="two">
<option...
|
by: phpnewbie26 |
last post by:
My current form has one multiple select drop down menu as well as few other drop down menus that are single select. Originally I had it so that the multiple select menu was first, but this created the problem that when I went to select the other drop down menus, the selections i made on the multiple select one would clear. Then I had tried putting...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
| |
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language...
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it. ...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |