Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

newbie query

Status
Not open for further replies.

conjurer111

Programmer
Aug 11, 2002
76
IN
Hi,

I have an ASP page with the following controls -

1. select box
2. button(execute)
3. textboxes
4. button(update)

when the page is loaded, I populate the select item with values from the database. Now what I need is that when I click on the execute button, a SQL query (select * from emp where empid = selectbox.value ) should fire taking input from the select boxes selected item value and populate the text boxes with the results of the query. Next I will make changes if any to the values in the textboxes and click on the update button so that the resulting values in the textboxes will be updated in the database. How do I code this.

Thanks.
 
I had this problem at one time. My solution was to have one submit button and 2 check boxes. One check box to run the query and 1 check box to update the info. I wrote if statements to look for the check box values upon form post. If the run query check box was checked the following code would run the query:

If Request.Form(&quot;chkRun_query&quot;) <> &quot;&quot; Then
your select query and code
End If

The above assumes your run query check box is named &quot;chkRun_query&quot;.

I also had an if statement for the update check box that looked like this:

If Request.Form(&quot;chkUpdate&quot;) <> &quot;&quot; Then
your update query and code
End If

Hope this helps..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top