Any ideas

Richard Sensale ( (no email) )
Mon, 5 Jan 1998 09:34:12 -0500

Hi Im still trying to write a web page report using the emerald database and
I must be missing something. Does anyone see any glaring errors with the
following code. It tries to run but either times out the sql server or
fills up the transaction log. It reads in much more data than it should.
I'd appreciate some help, this simple page has been driving me nuts for over
2 weeks and I honestly don't see where the problem is. I must be too close
to the problem.

<% StartDate = Request("StartDate")

EndDate = Request("EndDate") %>

<% IF (StartDate <> "") AND (EndDate <> "") THEN

Server.ScriptTimeout = 600

Session.Timeout = 90

IF IsObject(Session("EmeraldDSN_conn")) THEN

Set conn = Session("EmeraldDSN_conn")

ELSE

Set conn = Server.CreateObject("ADODB.Connection")

conn.open "DSN=EmeraldDSN; UID=Anonymous_WWW; PWD=anonweb4220"

Set Session("EmeraldDSN_conn") = conn

END IF

sql = "SELECT sa.Login, sa.AccountType, ma.CustomerID, ma.FirstName,
ma.LastName, ma.Region, ma.ReferredBy, ma.StartDate"

sql = sql & " FROM MasterAccounts ma, SubAccounts sa WHERE "

sql = sql & "(StartDate >= CONVERT(datetime, '" & StartDate & "')) AND "

sql = sql & "(StartDate <= CONVERT(datetime, '" & EndDate & "')) AND "

sql = sql & "(ma.Region = 'SEV') AND "

sql = sql & "(sa.AccountType = 'SEV-Residential')"

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

rs.Open sql, conn, 3, 3

On Error Resume Next

END IF %>

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">

SEV User Report Residential

<% IF(StartDate = "") OR (EndDate = "") THEN %>SEV ResidentialUser Report

StartingDate:(mm/dd/yy)
EndingDate:(mm/dd/yy)

 

<% ELSE %>

UserReport For Period ( <% = StartDate%> through <% = EndDate%>)

Newusers will have NEW in the Referred by column

Allothers are existing SEV users.

<% On Error Resume Nextrs.MoveFirstdo while not rs.EOF %> <% rs.MoveNextloop %>
FirstNameLastNameRegionReferredBySignupDate/TimeLoginID
<% = rs.Fields("FirstName").Value%><% = rs.Fields("LastName").Value %><% = rs.Fields("Region").Value%><% = rs.Fields("ReferredBy").Value%><% = rs.Fields("StartDate").Value%><% = rs.Fields("Login").Value%>

<% END IF %>