Page Does Nothing

Page Does Nothing

am 07.01.2005 21:00:51 von Jim in Arizona

I've become a bit frustrated at this point. What was once a simple project
turned into one more complex that I'm use to.

I originally had this working when it was a single text input field and a
single sql string calling up info from an access 2000 db. I tried to outdo
myself and now I can't get it to work and I have no idea why. I don't get
any error, it just fails to provide any result. This is my first time of
using sub procedures. Here's my code. My lines have autowrapped when I
pasted. I realize that I'm not suppose to enclose the values of
Response.Write in parenthases but I was in a hurry and copied and pasted
what I had previously made in another project. This fact didn't affect this
phonelist page before it grew to using sub procedures and select case. Any
advise on where I went wrong would be appreciated. Thanks.

<%@ Language=VBScript %>
<%
Dim Conn, SQL1, SQL2, SQL3, listing, sorttype

listing = Request.Form("listing")
sorttype = Request.Form("type")

Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
server.mappath("phonelist.mdb")

Set SQL1 = Conn.Execute("Select name, location, department, number,
extension FROM master WHERE name LIKE '%"& listing &"%' ORDER BY name")
Set SQL2 = Conn.Execute("Select name, location, department, number,
extension FROM master WHERE department LIKE '%" & listing & "%' ORDER BY
name, department")
Set SQL3 = Conn.Execute("Select name, location, department, number,
extension FROM master ORDER BY name")

Sub TBLA
Response.Write("

cellspacing=""0"" cellpadding=""7"" width=""100%"">")
Response.Write("" & _
"")
Do While NOT SQL1.EOF
Response.Write("")
SQL1.MoveNext
LOOP
Response.Write("
Name width=""20%"" valign=""bottom"">" & _
"Location
valign=""bottom"">DepartmentNumber valign=""bottom"">Ext.
")
Response.Write(SQL1.Fields("name") & "
")
Response.Write(SQL1.Fields("location") & "
")
Response.Write(SQL1.Fields("department") & "
")
Response.Write(SQL1.Fields("number") & "
")
Response.Write(SQL1.Fields("extension") & "
")
End Sub

Sub TBLB
Response.Write("

Department Listing For " &
listing & "

")
Response.Write(" cellspacing=""0"" cellpadding=""7"" width=""100%"">")
Response.Write("" & _
"")
Do While NOT SQL2.EOF
Response.Write("")
SQL2.MoveNext
LOOP
Response.Write("
Name width=""20%"" valign=""bottom"">" & _
"Location
valign=""bottom"">DepartmentNumber valign=""bottom"">Ext.
")
Response.Write(SQL2.Fields("name") & "
")
Response.Write(SQL2.Fields("location") & "
")
Response.Write(SQL2.Fields("department") & "
")
Response.Write(SQL2.Fields("number") & "
")
Response.Write(SQL2.Fields("extension") & "
")
End Sub

Sub TBLC
Response.Write("

HHS - All Internal
Numbers

")
Response.Write(" cellspacing=""0"" cellpadding=""7"" width=""100%"">")
Response.Write("" & _
"")
Do While NOT SQL3.EOF
Response.Write("")
SQL3.MoveNext
LOOP
Response.Write("
Name width=""20%"" valign=""bottom"">" & _
"Location
valign=""bottom"">DepartmentNumber valign=""bottom"">Ext.
")
Response.Write(SQL3.Fields("name") & "
")
Response.Write(SQL3.Fields("location") & "
")
Response.Write(SQL3.Fields("department") & "
")
Response.Write(SQL3.Fields("number") & "
")
Response.Write(SQL3.Fields("extension") & "
")
End Sub
%>



Untitled





In
Development


HHS Internal Phone Directory


Please Type A Name.


You
only have to type a portion of the name.
Two letters of the first name
will do.



Employee Lookup
   
Department Lookup
   
View All Employess






<%
Select Case sorttype
Case sortemp
TBLA
Case sortdept
TBLB
Case sortall
TBLC
End Select

SQL1.Close
SQL2.Close
SQL3.Close

Set Conn = Nothing

%>


Re: Page Does Nothing

am 07.01.2005 21:36:02 von unknown

Get in the habit of using Option Explicit at the top of your
pages.
I imagine that what you meant to use was:

Select Case sorttype
Case "sorttemp"
Call TBLA
Case "sortdept"
Call TBLB
Case "sortall"
Call TBLC
Case Else
Response.Write "None of the above selected. Value of sorttype: " &
sorttype
End Select


--

Ray at work
Microsoft ASP/ASP.NET MVP


"Jim in Arizona" wrote in message
news:OHmB6OP9EHA.1400@TK2MSFTNGP11.phx.gbl...
> I don't get
> any error, it just fails to provide any result.

> Sub TBLA
> End Sub
>
> Sub TBLB
> End Sub
>
> Sub TBLC
> End Sub

> Select Case sorttype
> Case sortemp
> TBLA
> Case sortdept
> TBLB
> Case sortall
> TBLC
> End Select

Re: Page Does Nothing

am 07.01.2005 21:47:46 von Jim in Arizona

"Ray Costanzo [MVP]" wrote in
message news:%23RNmCiP9EHA.208@TK2MSFTNGP12.phx.gbl...
> Get in the habit of using Option Explicit at the top of your
> pages.
I imagine that what you meant to use was:
>
> Select Case sorttype
> Case "sorttemp"
> Call TBLA
> Case "sortdept"
> Call TBLB
> Case "sortall"
> Call TBLC
> Case Else
> Response.Write "None of the above selected. Value of sorttype: "
> &
> sorttype
> End Select
>
>
> --
>
> Ray at work
> Microsoft ASP/ASP.NET MVP
>
>
> "Jim in Arizona" wrote in message
> news:OHmB6OP9EHA.1400@TK2MSFTNGP11.phx.gbl...
>> I don't get
>> any error, it just fails to provide any result.
>
>> Sub TBLA
>> End Sub
>>
>> Sub TBLB
>> End Sub
>>
>> Sub TBLC
>> End Sub
>
>> Select Case sorttype
>> Case sortemp
>> TBLA
>> Case sortdept
>> TBLB
>> Case sortall
>> TBLC
>> End Select
>
>


That's exactly what I meant, Ray. Thank you!
It's always something huh.

Option Explicit it is. :)