<% wLogin=request.item("Login") wSenha=request.item("Senha") wEmpresa=request.item("Empresa") wLetra=request.item("Letra") & "%" Set Conexao = Server.CreateObject("ADODB.Connection") Conexao.Open session("stringconexaobomdesorte") Sql = "SELECT Count(*) as Total FROM TICKETS WHERE CD_EMPRESA = " & wEMPRESA & "" Set rstempTotal = Conexao.Execute ( Sql ) Sql = "SELECT DISTINCT (C.NOME), C.Cliente, E.NOME AS EMPRESA FROM CLIENTES C LEFT JOIN TICKETS T ON (T.CD_CLIENTE = C.CLIENTE) LEFT JOIN EMPRESAS E ON (E.EMPRESA = T.CD_EMPRESA) LEFT JOIN PLANOS P ON (P.PLANO = T.PLANO) WHERE E.EMPRESA = " & wEMPRESA & " and E.Login = '" & wLogin & "' and E.Senha = '" & wSenha & "' AND C.NOME Like '" & wLetra & "' order by C.NOME" Set rstemp = Conexao.Execute ( Sql ) %>

<% If rstemp.eof then%> Não existe Nomes iniciados com essa letra.

<% else %>

 

EMPRESA:  <%=rstemp("EMPRESA")%>

 

Total de Clientes <%=rstempTotal("Total")%>

 

Todas     A B C D E F G H I J K L M N O P Q R S T U V X Z Y W 

 

<% While NOT rstemp.EoF %> <% rstemp.MoveNext %> <% Wend %>
Cliente
&Empresa=<%=wEmpresa%>"><%=rstemp("NOME")%>

 

<% END IF %>