Why is everyone using the IIS server as opposed to the HomeSeer server to run ASP to control Homeseer from the web? Maybe I am doing this wrong by using the Homeseer server (using the HTML folder in the Homeseer directory) to run my ASP pages, but I am getting a weird error and maybe someone can help. I am trying to read a database that has phone numbers and as I loop thru the result set using a While/WEND tags, I get the following error - Expected error -'Wend'.
But this work when I move my ASP pages to my Inetpub/wwwroot/phone project (IIS server)
here is the code witht he loop in bold, anyone have a clue?
<!--#include file="e/Connections/phone_con.asp" -->
<%@ LANGUAGE=VBScript %>
<%
OPTION EXPLICIT
Dim rs1__first_nme
rs1__first_nme = ""
if (Request.Form("first_nme") <> "") then rs1__first_nme = Request.Form("first_nme")
%>
<%
Dim rs1__last_nme
rs1__last_nme = ""
if (Request.Form("last_nme") <> "") then rs1__last_nme = Request.Form("last_nme")
%>
<%
Dim rs1__phne
rs1__phne = ""
if (Request.Form("phne") <> "") then rs1__phne = Request.Form("phne")
%>
<%
set rs1 = Server.CreateObject("ADODB.Recordset")
rs1.ActiveConnection = MM_phone_con_STRING
rs1.Source = "SELECT ID, FirstName, LastName, Company, Phone1, Listing, username,Format(updated,'mm/dd/yyyy') as hold_dte,Format(date(),'mm/dd/yyyy') as todays_dte FROM phonebook WHERE Lastname LIKE '" + Replace(rs1__last_nme, "'", "''") + "%' AND Firstname LIKE '" + Replace(rs1__first_nme, "'", "''") + "%' AND Phone1 LIKE '%" + Replace(rs1__phne, "'", "''") + "%' ORDER BY Lastname"
rs1.CursorType = 0
rs1.CursorLocation = 2
rs1.LockType = 3
rs1.Open()
rs1_numRows = 0
%>
<%
Dim Repeat1__numRows
Repeat1__numRows = 10
Dim Repeat1__index
Repeat1__index = 0
rs1_numRows = rs1_numRows + Repeat1__numRows
%>
<html>
<head>
<title>phone_test</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<%
Response.Write "phone sql " & rs1.Source
%>
<%
While ((Repeat1__numRows <> 0) AND (NOT rs1.EOF))
%>
<table width="75%" border="1">
<tr>
<td><%=(rs1.Fields.Item("FirstName").Value)%>< ;/td>
<td><%=(rs1.Fields.Item("LastName").Value)%>& lt;/td>
<td><%=(rs1.Fields.Item("Phone1").Value)%>< ;/td>
</tr>
</table>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rs1.MoveNext()
Wend
%>
</body>
</html>
<%
rs1.Close()
%>
nullWhile ((Repeat1__numRows <> 0) AND (NOT rs1.EOF))
But this work when I move my ASP pages to my Inetpub/wwwroot/phone project (IIS server)
here is the code witht he loop in bold, anyone have a clue?
<!--#include file="e/Connections/phone_con.asp" -->
<%@ LANGUAGE=VBScript %>
<%
OPTION EXPLICIT
Dim rs1__first_nme
rs1__first_nme = ""
if (Request.Form("first_nme") <> "") then rs1__first_nme = Request.Form("first_nme")
%>
<%
Dim rs1__last_nme
rs1__last_nme = ""
if (Request.Form("last_nme") <> "") then rs1__last_nme = Request.Form("last_nme")
%>
<%
Dim rs1__phne
rs1__phne = ""
if (Request.Form("phne") <> "") then rs1__phne = Request.Form("phne")
%>
<%
set rs1 = Server.CreateObject("ADODB.Recordset")
rs1.ActiveConnection = MM_phone_con_STRING
rs1.Source = "SELECT ID, FirstName, LastName, Company, Phone1, Listing, username,Format(updated,'mm/dd/yyyy') as hold_dte,Format(date(),'mm/dd/yyyy') as todays_dte FROM phonebook WHERE Lastname LIKE '" + Replace(rs1__last_nme, "'", "''") + "%' AND Firstname LIKE '" + Replace(rs1__first_nme, "'", "''") + "%' AND Phone1 LIKE '%" + Replace(rs1__phne, "'", "''") + "%' ORDER BY Lastname"
rs1.CursorType = 0
rs1.CursorLocation = 2
rs1.LockType = 3
rs1.Open()
rs1_numRows = 0
%>
<%
Dim Repeat1__numRows
Repeat1__numRows = 10
Dim Repeat1__index
Repeat1__index = 0
rs1_numRows = rs1_numRows + Repeat1__numRows
%>
<html>
<head>
<title>phone_test</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<%
Response.Write "phone sql " & rs1.Source
%>
<%
While ((Repeat1__numRows <> 0) AND (NOT rs1.EOF))
%>
<table width="75%" border="1">
<tr>
<td><%=(rs1.Fields.Item("FirstName").Value)%>< ;/td>
<td><%=(rs1.Fields.Item("LastName").Value)%>& lt;/td>
<td><%=(rs1.Fields.Item("Phone1").Value)%>< ;/td>
</tr>
</table>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rs1.MoveNext()
Wend
%>
</body>
</html>
<%
rs1.Close()
%>
nullWhile ((Repeat1__numRows <> 0) AND (NOT rs1.EOF))
Comment