% Dim sPath, sScriptDir, sDSN Const adOpenKeyset = 1 Const adLockPessimistic = 2 sScriptDir = Request.ServerVariables("SCRIPT_NAME") sScriptDir = StrReverse(sScriptDir) sScriptDir = Mid(sScriptDir, InStr(1, sScriptDir, "/")) sScriptDir = StrReverse(sScriptDir) sPath = Server.MapPath(sScriptDir) & "\" sDSN="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("/dados/mcruz3z.mdb") sSQLCat = "SELECT * FROM vid ORDER BY texto1" set RsCat=Server.CreateObject("ADODB.Recordset") RsCat.Open sSQLCat, sDSN, adOpenKeySet, adLockPessimistic sSQLCatx = "SELECT * FROM home ORDER BY ordem" set RsCatx=Server.CreateObject("ADODB.Recordset") RsCatx.Open sSQLCatx, sDSN, adOpenKeySet, adLockPessimistic If Not RsCatx.Bof then RsCatx.Movefirst End if %>
<%
tabela=request.QueryString("tb") ' videos nome da tabela
if tabela=null or tabela="" then
tabela="videos"
End if
b=request.QueryString("b") ' 5 qdade de linhas
numer=""
numer=request.QueryString("nm") ' num da noticia princ
cat=request.QueryString("Cat") 'categoria menu esq.
if cat="" or cat=null or cat="99" then
if cat<>"99" then
cat=""
End if
sSQLop = "SELECT * FROM "& tabela &" ORDER BY numero"
else
sSQLop = "SELECT * FROM "& tabela &" WHERE Categoria='"& Cat &"' ORDER BY numero"
b=5
End if
set RsOp=Server.CreateObject("ADODB.Recordset")
RsOp.Open sSQLop, sDSN, adOpenKeySet, adLockPessimistic
if not RsOp.Eof then
RsOp.Movefirst
a=RsOp("numero")
End if
if RsOp.Eof or numer="" then
a=1
numer="1"
End if
if cat<>"" then
numer=a
End if
Do Until RsOp.Eof or (a/numer)=1
RsOp.MoveNext
if Not RsOp.Eof then
a=RsOp("numero")
End if
Loop
if not RsOp.Eof then
%>
<% if b=0 then b=50 End if a=0 Do Until Rsop.Eof or a>b %> "> <%= RsOp("titulo") %><% a=a+1 RsOp.MoveNext Loop RsOp.Close Set RsOp = Nothing %> <% End if %> |
<%= RsCat("texto1") %> |
|
<% if RsCatx("imagem1")<>"" then %> " target="blank"> |