ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old August 18th, 2003, 09:13 AM
Rhaslani Rhaslani is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 10 Rhaslani User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Retrieiving Info from Database

I am trying to learn how to retrieve information from the database. I am not too familiar with ASP but I was told to use it. How do I go about doing this? What specific aspect of ASP do I need to learn? And if anyone has any code that can help me, please share. Any help would be greatly appreciated. Thanks.

Reply With Quote
  #2  
Old August 18th, 2003, 09:31 AM
Vlince Vlince is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Canada, Quebec, Montreal
Posts: 410 Vlince User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
---BEGIN QUOTE---
I am trying to learn how to retrieve information from the database
---END QUOTE---

Humm....



---BEGIN QUOTE---
I am not too familiar with ASP but I was told to use it.
---END QUOTE---

Ok this is where things get confusing and **YOU** need to be more specific!

I don't care WHO told you to use ASP, my question to you is :
"what's the application/stuff your working on?"
Is it web oriented?

I can only assume since you've posted in the ASP forum but again, that can be anything...


What is it your doing???
What language are you using???
Which environment are you in???
Which OS are you using???
Which database are you using???
Which version of IIS are you using, if its an web application???
What???

Don't get me wrong, I want to help you but in order to do so, you'll need to help yourself first!

If you've been told to use ASP then I guess your using ASP pages right? is that correct?
Are you using HTML pages?


Or are you using/cerating a VB application(Desktop)???

Is it an INTERNET application?
Or
Is it an DESKTOP application?

What?

Hope this helps!
Sincerely

Vlince

Reply With Quote
  #3  
Old August 18th, 2003, 09:36 AM
Rhaslani Rhaslani is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 10 Rhaslani User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Whoa, Thats a lot of questions. But here I go.

I am working on an internet application of which the first page is an HTML page. There are hidden values passed from the HTML page to an asp page. I need to use the hidden values that were passed to run a query. Here is my problem. I have 2 drop down menues on my HTML page, from which ONE item must be selected. So there should be 2 values passed on, one from each menu. I need to use a combination of those two values to run the query. I have no idea how to do this. I hope that is better. If you could guide me as to what to focus on, or some sample code, that would be great. Thanks!

Reply With Quote
  #4  
Old August 18th, 2003, 10:02 AM
Vlince Vlince is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Canada, Quebec, Montreal
Posts: 410 Vlince User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Ok so this is what you basically have:

-----------------HTML PAGE------------------------
<html>
<body>

<form name="frmMain" action="test.asp" method="POST">

<Hidden Field 1>
<Hidden Field 2>

<Combobox 1>

<Combobox 2>


<Submit Button>
</form>

</body>
</html>
-----------------HTML PAGE------------------------


Now, notice the action attribute, it is equal to test.asp that means that when the user clicks on your <Submit Button> *ALL* the information held between the tag <form> and </form> will be sent to the page test.asp

Also note the method attribute that is equal to *POST* that is important because that tells us(the programmer) HOW the data is SENT from your <form>...</form>.

Now let's code the test.asp page...


-----------------------ASP PAGE--------------------------
<%@ Language=VBScript %>

<%
Dim strValue_Of_HiddenField1
Dim strValue_Of_HiddenField2
Dim strValue_Of_Combobox_1
Dim strValue_Of_Combobox_2


strValue_Of_HiddenField1 = Trim(Request.Form("hid1"))
strValue_Of_HiddenField2 = Trim(Request.Form("hid2"))

'NOTE: I've assumed that the names of the 2 hidden fields
'were hid1 and hid2
'Also note that I've used the .Form to retrieve the data
'NOT .QueryString Why?????
'Because the method attribute of your <form>...</form>
'was set to equal POST remember???



'Ok now let's retrieve the data for the two combobox's

strValue_Of_Combobox_1 = Trim(Request.Form("cbo1"))
strValue_Of_Combobox_2 = Trim(Request.Form("cbo2"))

'NOTE: I've assumed that the names of the 2 combobox fields
'were cbo1 and cbo2


'So...now you have/hold into VARIABLES the data chosen/selected by your users...

'What next???....

'You say you need to make a combination of the 2 values right?
'What do you mean by combination?
'Do you mean you need to execute TWO different Queries?
'OR
'Do you mean you need to concatenate the TWO values AND then execute an SQL Query?

%>


Hope this helps!
Sincerely

Vlince

Reply With Quote
  #5  
Old August 18th, 2003, 10:11 AM
Rhaslani Rhaslani is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 10 Rhaslani User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
This is my code for the first page:

<body>
<hr align="center">
<h2 align="center"> <font face="Arial" color="#000099"> Production Statistics Reporting Application</font> </h2>
<hr align="center">

<form id ="form1" method="POST" action="results1.asp">
<p><font color="#000099">Select an Application:
<p><select size="1" name="Application">
<option></option>
<option>Airtrac</option>
<option>Banker Evaluation</option>
<option>Best Books</option>
<option>CDG - GB2000</option>
<option>Central Services</option>
<option>Citivision</option>
<option>Clients</option>
<option>Compass</option>
<option>Deal Management System</option>
<option>ECM - Equity Capital Management</option>
<option>GB - Market Data</option>
<option>GB Framework</option>
<option>HATS</option>
<option>Headcount System</option>
<option>IB Information Exchange</option>
<option>IB Subledger</option>
<option>Information Services</option>
<option>Legal Counsel Law Firms</option>
<option>M&A Week in Review</option>
<option>MarketShare</option>
<option>New Business Memorandum</option>
<option>Photolibrary</option>
<option>Pitch Book</option>
<option>Radar</option>
<option>SDA/Syndicates</option>
<option>Total Performance Management</option>
</select></p>

<p>Select a Variable:</p>
<p><select size="1" name="Variable">
<option></option>
<option>Amount of Dollars</option>
<option>Amount of Hours</option>
<option>Number of Tickets</option>
</select></p>

<input type="button" onclick= "ValidateForm()" name="my_submit" value="Submit">

</form>


<SCRIPT language="javascript">
function ValidateForm()
{
if(document.all("Application").selectedIndex == 0)
{
alert('You have not entered an Application. Please enter it now.')
//form.application.();
return false;
}

if(document.all("Variable").selectedIndex == 0)
{
alert('You have not entered an Variable. Please enter it now.')
//form.variable.();
return false;
}
form1.submit();
return true;
}


</SCRIPT>

</font>

</body>




The second Page I have this:


<body>
<hr align="center">

<p align="center"><font color="#000099"><b>Results Page</b></font></p>
<hr align="center">
<p><font color="#990033">The values selected are:</font></p>


<%

Dim sOutput

sOutput = Request.Form("application") & "<br>" & Request.Form("variable")
Response.Write(sOutput)

%>


<p><a href="prod_stats_app.htm"><font color="#990033">Go back</font></a></p>


</body>


I Want to run a query based on the combination of the two hidden values. Also, I dont quite understand what you mean by Combobox - I dont really have that. Do I need that?

You really are helping a lot! I want to thank you so much! All your help is greatly appreciated!

Reply With Quote
  #6  
Old August 18th, 2003, 10:36 AM
Vlince Vlince is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Canada, Quebec, Montreal
Posts: 410 Vlince User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
---BEGIN QUOTE---
Also, I dont quite understand what you mean by Combobox - I dont really have that. Do I need that?
---END QUOTE---

Didn't YOU say you had:
---BEGIN QUOTE---
I have 2 drop down menues on my HTML page
---END QUOTE---

Now to ME a drop down menu means a combobox/dropdownbox no???

You see, how **IMPORTANT** terminology IS...this avoids confusing and long post reponses...for nothing


Now, to me a COMBINATION of two things MEANS:
The two of them together...like GIN AND TONIC that is a combination of the TWO

So a combination of two variables IS the two of them together

So, my question to you is:
What is YOUR definition of combination???

Is it:

<%
Dim strTotal
Dim strVar1
Dim strVar2

strTotal = strVar1 & strVar2
'FOR DEBUG ONLY
'Response.Write strTotal
'Response.End
%>

Then you want to query with the variable **strTotal**


OR is it:

<%
Dim strVar1
Dim strVar2

'Build Query 1 with variable ***strVar1***

'Build Query 2 with variable ***strVar2***
%>

Hope this helps!
Sincerely

Vlince

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > Retrieiving Info from Database


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway