If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Button On Click event

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-09-05, 08:00
Rachael2 Rachael2 is offline
Registered User
 
Join Date: Feb 2005
Posts: 1
Button On Click event

Hi guys i have established a connection between my database and front end and now have the data i require displayed in a list box when i run my application, which is the code i have included below. i now need to amend the program so that this information is only displayed in the list box when i click a button, but am unsure how to attempt this.

Any help would be greatly appreciated.

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
dim conn
dim rs
set conn = Server.CreateObject("ADODB.Connection")

conn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source =" & Server.Mappath("./db1.mdb ") & _
"; Jet OLEDB:Database Password="



set rs = Server.CreateObject("ADODB.Recordset")

rs.Open "SELECT Word FROM Words WHERE Word LIKE 'A%' ", conn
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<body>
<p>
<select name="list1" size="5">
<%
rs.MoveFirst
Do While NOT rs.EOF
%>
<option value='<%= rs.Fields("Word").Value%>'><%= rs.Fields("Word").Value%></option>
<%
rs.MoveNext
Loop
%>
</select>
</p>
<p>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="80" height="22">
<param name="movie" value="ButtonA.swf">
<param name="quality" value="high">
<embed src="ButtonA.swf" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="80" height="22" ></embed>
</object>
</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp; </p>
</body>
</html>
<%
rs.Close
conn.Close
set rs=nothing
set conn=nothing
%>
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On