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

Select and display

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.Expires = -1000 'Make sure the browser doesnt
cache this page
Response.Buffer = True 'enables our response.redirect to
work

If Request.Form("valuepassed") ="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>&nbsp;</p>
<p><font size="2" face="Verdana, Arial, Helvetica, sans-
serif">Welcome Back!</font></p>
<form name="calculations" action="report.asp"
method="post">
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="24%" height="21"><strong><font size="2"
face="Verdana, Arial, Helvetica, sans-serif">Gross
Orders</font></strong></td>
<td width="76%"><strong><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>&nbsp;</p>
<p>&nbsp;</p></td>
</tr>
</table>
<% End Sub %>

Jul 19 '05 #1
6 1591
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.Expires = -1000 'Make sure the browser doesnt
cache this page
Response.Buffer = True 'enables our response.redirect to
work

If Request.Form("valuepassed") ="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>&nbsp;</p>
<p><font size="2" face="Verdana, Arial, Helvetica, sans-
serif">Welcome Back!</font></p>
<form name="calculations" action="report.asp"
method="post">
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="24%" height="21"><strong><font size="2"
face="Verdana, Arial, Helvetica, sans-serif">Gross
Orders</font></strong></td>
<td width="76%"><strong><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>&nbsp;</p>
<p>&nbsp;</p></td>
</tr>
</table>
<% End Sub %>

Jul 19 '05 #2
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.Expires = -1000 'Make sure the browser doesnt
cache this page
Response.Buffer = True 'enables our response.redirect to
work

If Request.Form("valuepassed") ="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>&nbsp;</p>
<p><font size="2" face="Verdana, Arial, Helvetica, sans-
serif">Welcome Back!</font></p>
<form name="calculations" action="report.asp"
method="post">
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="24%" height="21"><strong><font size="2"
face="Verdana, Arial, Helvetica, sans-serif">Gross
Orders</font></strong></td>
<td width="76%"><strong><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>&nbsp;</p>
<p>&nbsp;</p></td>
</tr>
</table>
<% End Sub %>

Jul 19 '05 #3
me
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.Expires = -1000 'Make sure the browser doesnt
cache this page
Response.Buffer = True 'enables our response.redirect to work

If Request.Form("valuepassed") ="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="calculations" action="report.asp"
method="post">
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="24%" height="21"><strong><font size="2"
face="Verdana, Arial, Helvetica, sans-serif">Gross
Orders</font></strong></td>
<td width="76%"><strong><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 %>

.

Jul 19 '05 #4
> Strsales and orders are variables not objects, unless i
am wrong,


No, they are recordset objects.
Jul 19 '05 #5
Sorry i am using a SQL 2000 Server heh
-----Original Message-----
Function Orders
Dim myconn, myconn2, strorders
Set myconn = Server.CreateObject("ADODB.Connection")
Set myconn2 = Server.CreateObject("ADODB.Connection")

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.CreateObject("ADODB.Connection")
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.

Anyone
got any ideas?

Thanks!

<%
Response.Expires = -1000 'Make sure the browser doesnt
cache this page
Response.Buffer = True 'enables our response.redirect towork

If Request.Form("valuepassed") ="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="calculations" action="report.asp"
method="post">
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="24%" height="21"><strong><font size="2"
face="Verdana, Arial, Helvetica, sans-serif">Gross
Orders</font></strong></td>
<td width="76%"><strong><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 %>

.

.

Jul 19 '05 #6
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.com> wrote in message
news:15****************************@phx.gbl...
Sorry i am using a SQL 2000 Server heh

Jul 19 '05 #7

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

Similar topics

3
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...
1
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...
2
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...
3
by: d.schulz81 | last post by:
Hi all how can i manipulate a multiple select into a single select dropdown field with JavaScript? thanks
14
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...
0
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...
4
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...
1
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...
2
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)"> ...
6
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...
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: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.