Forums

ASP

This topic is locked

missing fields

Posted 07 Jun 2006 07:58:07
1
has voted
07 Jun 2006 07:58:07 c foss posted:
After a long absence, I've started back with ASP. I'm having an odd problem. I used Dreamweaver's (version 8) builtin Recordset behaviour to create a recordset. My problem is some fields are being returned as blank even though I know they're not empty. I have the same result whether I hand code it or only use Dreamweaver's point and click tools. I'm wondering if it's maybe a problem with my enviroment????

My setup:
Windows XP Pro
IIS
MS SQL Server 2005 Express
Dreamweaver 8

Connecting with a datasource I created in the control panel

Replies

Replied 07 Jun 2006 08:03:15
07 Jun 2006 08:03:15 c foss replied:
In case it helps:

<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="admin/_functions.asp" -->
<!--#include file="Connections/default.asp" -->
<%
Dim rs_agents__MMColParam
rs_agents__MMColParam = "1"
If (Request.QueryString("province" <> "" Then
rs_agents__MMColParam = Request.QueryString("province"
End If
%>
<%
Dim rs_agents
Dim rs_agents_numRows

Set rs_agents = Server.CreateObject("ADODB.Recordset"
rs_agents.ActiveConnection = MM_default_STRING
rs_agents.Source = "SELECT * FROM dbo.agents WHERE province = '" + Replace(rs_agents__MMColParam, "'", "''" + "' ORDER BY agent_name ASC"
rs_agents.CursorType = 0
rs_agents.CursorLocation = 2
rs_agents.LockType = 1
rs_agents.Open()

rs_agents_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index

Repeat1__numRows = -1
Repeat1__index = 0
rs_agents_numRows = rs_agents_numRows + Repeat1__numRows
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="stylesheet" type="text/css" href="scripts/pacific.css">
<script src="scripts/menu.js" type="text/javascript"></script>
<script src="scripts/bannerrand.js" type="text/javascript"></script>
<title>Pacific Wine & Spirits</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body topmargin=0 leftmargin=0 rightmargin=0 bottommargin=0>
<table width="764" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><!--#include file="includes/pacificHeader.inc"--></td>
</tr>
<tr>
<td background="images/menuBg.gif"><!--#include file="includes/mainMenu.inc"-->
</td>
</tr>
<tr>
<td class="content"><h1>Alberta Pacific Wine & Spirits Agents</h1>
<%
While ((Repeat1__numRows <> 0) AND (NOT rs_agents.EOF))
%>
<div class="bio">
<h4 class="title"><%=(rs_agents.Fields.Item("agent_name".Value)%></h4>
<h4 class="bioTitle"><%=(rs_agents.Fields.Item("title".Value)%></h4>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top"><p><em class="contact">Phone</em>   <strong><%=(rs_agents.Fields.Item("phone".Value)%></strong><br>
<em class="contact">Email</em>   <strong><a href="mailto:<%=(rs_agents.Fields.Item("email".Value)%>"><%=(rs_agents.Fields.Item("email".Value)%></a></strong> 
<img src="images/divider.gif">   <em class="contact">Territory</em>  <strong><%=(rs_agents.Fields.Item("territory".Value)%></strong><br>
</p></td>
</tr>
<tr>
<td><p class="agentBar"><%=(rs_agents.Fields.Item("bio".Value)%></p></td>
</tr>
<% If rs_agents.Fields.Item("price_list_file".Value <> "" Then %>
<tr>
<td><p><em class="contact">Price List:</em> <strong><a href="/files/<%=(rs_agents.Fields.Item("price_list_file".Value)%>">Download</a></strong></p></td>
</tr>
<% End If %>
</table>
</div>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rs_agents.MoveNext()
Wend
%></td>
</tr>
<tr>
<td><!--#include file="includes/footer.inc"-->
</td>
</tr>
</table>
</body>
</html>
<%
rs_agents.Close()
Set rs_agents = Nothing
%>

Reply to this topic