Jump to content
Fórum Script Brasil
  • 0

erro codigo


rafaelsetti
 Share

Question

bom dia, por favor alguém poderia me ajudar com este código ?

<%
sub abreconexao
const cntCaminho="C:\serieweb\ecommerce\database\editora.mdb"
Set conEditora=Server.CreateObject("ADODB.Connection")
ConEditora.Open "provider=microsoft.jet.oledb.4.0;data source="&cntCaminho&";"
end sub
sub fechaconexao
conEditora.close
set conEditora=nothing
end sub
%>

<%
OPTION EXPLICIT
%>
<!--#INCLUDE FILE="CONEXAO.INC"-->
<%
RESPONSE.EXPIRES=0
DIM ConEditora
dim categoria,numlivros,rstcat, STRCAT, NUMCAT,STRDATA, RSTDATA, datainicial,DataFinal,STRNREGISTROS, RSTNREGISTROS 
DIM STRLIVROS, RSLIVROS
CALL abreconexao
STRDATA="SELECT MAX (DTLANC) AS TOPDATA FROM LIVROS "
set RSTDATA = CONEDITORA.EXECUTE(STRDATA)
DataFinal=RSTDATA.fields("TOPDATA")
datainicial=((DataFinal-30))
STRNREGISTROS="SELECT COUNT (ISBN) AS NUMLIVROS FROM LIVROS "
STRNREGISTROS = STRNREGISTROS & "WHERE LIVROS.DTLANC >=#" & DATAINICIAL & "#"
set RSTNREGISTROS = CONEDITORA.EXECUTE(STRNREGISTROS)
strLivros = "SELECT * "
strLivros = strLivros & "FROM Livros "

strLivros = strLivros & "INNER JOIN Categorias "

strLivros = strLivros & "ON livros.codCategoria = Categorias.codCategoria "

strLivros = strLivros & "WHERE livros.dtLanc BETWEEN #" & dataInicial & "# and #" & dataFinal & "#  "

strLivros = strLivros & "ORDER BY livros.dtLanc desc"


Set rsLivros = CONEDITORA.Execute(strLivros)
 

STRCAT="SELECT * "
STRCAT = STRCAT & "FROM CATEGORIAS "
STRCAT = STRCAT & "ORDER BY CATEGORIA ASC "
set rstcat = CONEDITORA.EXECUTE(STRCAT)


%>

 

Obrigado,

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



  • Forum Statistics

    • Total Topics
      149.9k
    • Total Posts
      646.8k
×
×
  • Create New...