Ask a Question related to Dreamweaver AppDev, Design and Development.
-
longsdale #1
Show if recordset is empty??
Hi,
I have a results page with two result boxes and am trying to add 'Show if
recordset is empty' for obvious reasons. BUT i've highlighted text (eg,
criteria error) for one and used the show if.... which works fine but when i
try to add it to the second box (different recordset) it doesn't, WHY??
Anyhelp on this please?
Ian
longsdale Guest
-
Show region if recordset is not empty
Hi? How can I make server behavior for this?: If Diet field empty in the food table,Don?t display Diet word in the Page <% If Not Food.EOF... -
Why Dreamweaver edit the Recordset will show thiserror?
In your Connection file, change MM_Habook_STRING = 'dsn=Habook;' to MM_Habook_STRING = 'dsn=Habook;un=; pw=' Where the username and password have... -
recordset paging won't show second page
Hi I'm querying a database and returning the records using absolute page and all that stuff. The user can choose to do a keyword search or... -
Load Empty Recordset
Hi All, Is it possible to load an empty recordset into a page for the purpose of setting up the page for a new record? The following code (there... -
Set an Empty Recordset?
You could throw in a rsQuery.Movelast Sometimes what I'll do in testing is: CONST TRAP_STOP = 10 DIM TRAP_COUNT TRAP_COUNT = 1 -
longsdale #2
Re: Show if recordset is empty??
One working and one not but from two seperate recordsets......? In the same table but without a repeat region so that shouldn't have anything to do with it should it?
Ian
longsdale Guest
-
Les Matthews #3
Re: Show if recordset is empty??
I think you will have to post some code to obtain assistance.
"longsdale" <webforumsuser@macromedia.com> wrote in message
news:d2h9jb$9l3$1@forums.macromedia.com...> One working and one not but from two seperate recordsets......? In the
> same table but without a repeat region so that shouldn't have anything to
> do with it should it?
> Ian
Les Matthews Guest
-
longsdale #4
Re: Show if recordset is empty??
Does this help??
<%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%>
<!--#include file="Connections/conn.asp" -->
<%
var result__MMColParam = "1";
if (String(Request.Form("Product")) != "undefined" &&
String(Request.Form("Product")) != "") {
result__MMColParam = String(Request.Form("Product"));
}
%>
<%
var result = Server.CreateObject("ADODB.Recordset");
result.ActiveConnection = MM_conn_STRING;
result.Source = "SELECT Product FROM Products WHERE Product LIKE '%"+
result__MMColParam.replace(/'/g, "''") + "%' ORDER BY Product";
result.CursorType = 0;
result.CursorLocation = 2;
result.LockType = 1;
result.Open();
var result_numRows = 0;
%>
<%
var shop__MMColParam = "1";
if (String(Request.Form("shop")) != "undefined" &&
String(Request.Form("shop")) != "") {
shop__MMColParam = String(Request.Form("shop"));
}
%>
<%
var shop = Server.CreateObject("ADODB.Recordset");
shop.ActiveConnection = MM_conn_STRING;
shop.Source = "SELECT Name FROM Shops WHERE Name LIKE '%"+
shop__MMColParam.replace(/'/g, "''") + "%' ORDER BY Name ASC";
shop.CursorType = 0;
shop.CursorLocation = 2;
shop.LockType = 1;
shop.Open();
var shop_numRows = 0;
%>
<html>
<head>
<title>result</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if
((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight;
onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH)
location.reload();
}
MM_reloadPage(true);
//-->
</script>
<link href="testcss.css" rel="stylesheet" type="text/css">
</head>
<body>
</td>
<td colspan="2" bgcolor="#000066">
<div align="left"><strong><font color="#FFFFFF"
size="3" face="Arial, Helvetica, sans-serif"><a href="product_shop_search.asp"
class="home">Home</a></font></strong></div>
</td>
</tr>
</table>
<br>
<table width="75%" border="0" align="center">
<tr>
<td><form action="product_shop_details.asp" method="post" name="form"
id="form">
<p align="center"><font size="2" face="Arial, Helvetica,
sans-serif">Your
results from the products and shops table are as follows..</font>
</p>
<p align="center">
<% if (result.EOF && result.BOF) { %>
Nothing selected or nothing to show for Products
<% } // end result.EOF && result.BOF %>
<select name="select">
<option value="" <%=(("" ==
(result.Fields.Item("Product").Value))?"SELECTED": "")%>>Products... </option>
<%
while (!result.EOF) {
%>
<option value="<%=(result.Fields.Item("Product").Value)%>"
<%=((result.Fields.Item("Product").Value ==
(result.Fields.Item("Product").Value))?"SELECTED": "")%><%><%=(result.Fields.Item("Product").Value)%></option>
result.MoveNext();
}
if (result.CursorType > 0) {
if (!result.BOF) result.MoveFirst();
} else {
result.Requery();
}
%>
</select>
</p>
<p align="center">
<% if (shop.EOF && shop.BOF) { %>
Shops
<% } // end shop.EOF && shop.BOF %>
<select name="select2">
<option value="" <%=(("" ==
(shop.Fields.Item("Name").Value))?"SELECTED":"")%> >Shops... </option>
<%
while (!shop.EOF) {
%>
<option value="<%=(shop.Fields.Item("Name").Value)%>"
<%=((shop.Fields.Item("Name").Value ==
(shop.Fields.Item("Name").Value))?"SELECTED":"")%><%><%=(shop.Fields.Item("Name").Value)%></option>
shop.MoveNext();
}
if (shop.CursorType > 0) {
if (!shop.BOF) shop.MoveFirst();
} else {
shop.Requery();
}
%>
</select>
</p>
<p align="center">
<input type="submit" name="Submit" value="OK">
</p>
</form>
</td>
</tr>
</table>
</body>
</html>
<%
result.Close();
%>
<%
shop.Close();
%>
longsdale Guest
-
Don Pacino #5
Re: Show if recordset is empty??
i now this might sound stupid but when you add the SHOW IF feature to the second recordset, do you change the recordset it is being applied to from the drop down box?
Don Pacino Guest



Reply With Quote

