Announcement

Collapse
No announcement yet.

Difference between HS server and IIS

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Difference between HS server and IIS

    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)%>&lt ;/td>
    <td><%=(rs1.Fields.Item("LastName").Value)%>& lt;/td>
    <td><%=(rs1.Fields.Item("Phone1").Value)%>&lt ;/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))

    #2
    Loops must be completely contained within a set of script tags in the HS webserver. Try writing your html within the loop with Response.Write commands instead.

    <%
    While ((Repeat1__numRows <> 0) AND (NOT rs1.EOF))
    Response.Write "<table width=""75%"" border=""1"">" & vbNewLine
    Response.Write "<tr>" & vbNewLine
    Response.Write "<td>" & rs1.Fields.Item("FirstName").Value & "</td>" & vbNewLine
    Response.Write "<td>" & rs1.Fields.Item("LastName").Value & "</td>" & vbNewLine
    Response.Write "<td>" & rs1.Fields.Item("Phone1").Value & "</td>" & vbNewLine
    Response.Write "</tr>" & vbNewLine
    Response.Write "</table>" & vbNewLine
    Repeat1__index=Repeat1__index+1
    Repeat1__numRows=Repeat1__numRows-1
    rs1.MoveNext()
    Wend
    %>


    Paul

    Comment


      #3
      Thanks Paul, it works!!!! I should have known because JSP's are the same way, you need to use an
      out.print("<td>");

      to get Hmtl to work, thanks again.

      Comment

      Working...
      X