ivofb Postado Abril 22, 2009 Denunciar Share Postado Abril 22, 2009 :rolleyes: Boa Noite Pessoal!Sou novato em ASP (totalmente) e consegui um script dos Aniv. do Mês, mas não está saindo como eu queria. Eu preciso que ele mostre todos os aniv. do mês e ele só me mostra os do dia. Alguém pode me ajudar? Obrigado.Segue o código completo abaixo:<% '********************************************************************************' '* This is a simple to install program - just place the Today.asp file anywhere *' '* on your site, and alter the global variables below to customize how it looks *' '********************************************************************************' mTitleColor = "DARKRED" '* This is the color of the title 'Today in History' *' mHeaderColor = "DARKBLUE" '* This is the color of the headers, Birthdays, Events *' mYearColor = "DARKBLUE" '* This is the color of the year *' mTextColor = "#069" '* This is the color of the text of the birthday or event *' mTitle = "Aniversariantes do Mês: " '* What you want to appear as the title *' mDataBaseDir = "Today.mdb" '*****************************************************' '* This is the location of the Today.mdb file in *' '* regards to your home directory - in this example *' '* it is the same directory as the Today.asp file *' '****************************************************' '* Function to return the verbose month given an integer 1-12 *' function toLongMonth(pInInteger) mMonth = "Não encontrado" if isNumeric(pInInteger) then select case pInInteger case 1: mMonth = "Janeiro" case 2: mMonth = "Fevereiro" case 3: mMonth = "Março" case 4: mMonth = "Abril" case 5: mMonth = "Maio" case 6: mMonth = "Junho" case 7: mMonth = "Julho" case 8: mMonth = "Augosto" case 9: mMonth = "Setembro" case 10: mMonth = "Outubro" case 11: mMonth = "Novembro" case 12: mMonth = "Dezembro" end select end if toLongMonth = mMonth end function '* Open DSNless connection to Today.mdb *' set connGlobal = server.createobject("ADODB.Connection") connGlobal.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ= " & server.mappath(mDataBaseDir) '* SQL Statement to pull data *' mSQL = "SELECT his_type, his_day, his_desc FROM UNV_HISTORY " & _ " WHERE his_day = datepart('d', date()) " & _ " AND his_month = datepart('m', date()) " & _ " ORDER BY his_day, his_desc " '* Execute the SQL statement *' set rsGlobal = connGlobal.execute(mSQL) '* Display The Title *' response.write "<FONT COLOR = " & mTitleColor & " SIZE = '1'><B>" & mTitle & _ toLongMonth(datepart("m", date())) & _ " " & datepart("yyyy", date()) & _ "</b></FONT><BR><BR>" '* Display The Birthday Tag *' response.write "<FONT COLOR = " & mHeaderColor & "><B>Parabéns:</b></FONT>" mType = "B" '* Initialize a table that will be used to format results of rsGlobal *' response.write "<TABLE WIDTH = '100%'>" '* Loop through recordset *' while not rsGlobal.eof '* Check to see if the type has changed, if so change the Tag to Events: *' 'if rsGlobal("his_type") <> mType then ' mType = "E" ' response.write "</TABLE><BR><FONT COLOR = " & mHeaderColor & "><B>Events:</b></FONT>" ' response.write "<TABLE WIDTH = '100%'>" 'end if '* Display a single line from the result set *' response.write "<TR VALIGN = TOP><TD ALIGN = RIGHT WIDTH = '5%'><FONT COLOR = " & _ mYearColor & " SIZE = '-4'><B> " & rsGlobal("his_day") & "</b></font></td>" response.write "<TD WIDTH = '95%'><FONT COLOR = " & mTextColor & " SIZE = '-4'>" & rsGlobal("his_desc") & "</FONT></td></tr>" '* Move to the next record *' rsGlobal.movenext wend '* Close the table *' response.write "</TABLE>" '* Close the recordset and connection *' rsGlobal.close set rsGlobal = nothing connGlobal.close set connGlobal = nothing '* All Done *'%> Link para o comentário Compartilhar em outros sites More sharing options...
0 bareta Postado Abril 22, 2009 Denunciar Share Postado Abril 22, 2009 ai fica dificil né... tire do where a busca pelo dia atual... his_day = datepart('d', date()) Link para o comentário Compartilhar em outros sites More sharing options...
0 ivofb Postado Abril 22, 2009 Autor Denunciar Share Postado Abril 22, 2009 ai fica dificil né... tire do where a busca pelo dia atual... his_day = datepart('d', date()) :D Valeu mesmo BARETA. Você é o cara. Muito obrigado.São pessoas como você que fazem do mundo um lugar melhor. Link para o comentário Compartilhar em outros sites More sharing options...
Pergunta
ivofb
:rolleyes: Boa Noite Pessoal!
Sou novato em ASP (totalmente) e consegui um script dos Aniv. do Mês, mas não está saindo como eu queria. Eu preciso que ele mostre todos os aniv. do mês e ele só me mostra os do dia. Alguém pode me ajudar? Obrigado.
Segue o código completo abaixo:
<%
'********************************************************************************'
'* This is a simple to install program - just place the Today.asp file anywhere *'
'* on your site, and alter the global variables below to customize how it looks *'
'********************************************************************************'
mTitleColor = "DARKRED" '* This is the color of the title 'Today in History' *'
mHeaderColor = "DARKBLUE" '* This is the color of the headers, Birthdays, Events *'
mYearColor = "DARKBLUE" '* This is the color of the year *'
mTextColor = "#069" '* This is the color of the text of the birthday or event *'
mTitle = "Aniversariantes do Mês: " '* What you want to appear as the title *'
mDataBaseDir = "Today.mdb" '*****************************************************'
'* This is the location of the Today.mdb file in *'
'* regards to your home directory - in this example *'
'* it is the same directory as the Today.asp file *'
'****************************************************'
'* Function to return the verbose month given an integer 1-12 *'
function toLongMonth(pInInteger)
mMonth = "Não encontrado"
if isNumeric(pInInteger) then
select case pInInteger
case 1: mMonth = "Janeiro"
case 2: mMonth = "Fevereiro"
case 3: mMonth = "Março"
case 4: mMonth = "Abril"
case 5: mMonth = "Maio"
case 6: mMonth = "Junho"
case 7: mMonth = "Julho"
case 8: mMonth = "Augosto"
case 9: mMonth = "Setembro"
case 10: mMonth = "Outubro"
case 11: mMonth = "Novembro"
case 12: mMonth = "Dezembro"
end select
end if
toLongMonth = mMonth
end function
'* Open DSNless connection to Today.mdb *'
set connGlobal = server.createobject("ADODB.Connection")
connGlobal.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ= " & server.mappath(mDataBaseDir)
'* SQL Statement to pull data *'
mSQL = "SELECT his_type, his_day, his_desc FROM UNV_HISTORY " & _
" WHERE his_day = datepart('d', date()) " & _
" AND his_month = datepart('m', date()) " & _
" ORDER BY his_day, his_desc "
'* Execute the SQL statement *'
set rsGlobal = connGlobal.execute(mSQL)
'* Display The Title *'
response.write "<FONT COLOR = " & mTitleColor & " SIZE = '1'><B>" & mTitle & _
toLongMonth(datepart("m", date())) & _
" " & datepart("yyyy", date()) & _
"</b></FONT><BR><BR>"
'* Display The Birthday Tag *'
response.write "<FONT COLOR = " & mHeaderColor & "><B>Parabéns:</b></FONT>"
mType = "B"
'* Initialize a table that will be used to format results of rsGlobal *'
response.write "<TABLE WIDTH = '100%'>"
'* Loop through recordset *'
while not rsGlobal.eof
'* Check to see if the type has changed, if so change the Tag to Events: *'
'if rsGlobal("his_type") <> mType then
' mType = "E"
' response.write "</TABLE><BR><FONT COLOR = " & mHeaderColor & "><B>Events:</b></FONT>"
' response.write "<TABLE WIDTH = '100%'>"
'end if
'* Display a single line from the result set *'
response.write "<TR VALIGN = TOP><TD ALIGN = RIGHT WIDTH = '5%'><FONT COLOR = " & _
mYearColor & " SIZE = '-4'><B> " & rsGlobal("his_day") & "</b></font></td>"
response.write "<TD WIDTH = '95%'><FONT COLOR = " & mTextColor & " SIZE = '-4'>" & rsGlobal("his_desc") & "</FONT></td></tr>"
'* Move to the next record *'
rsGlobal.movenext
wend
'* Close the table *'
response.write "</TABLE>"
'* Close the recordset and connection *'
rsGlobal.close
set rsGlobal = nothing
connGlobal.close
set connGlobal = nothing
'* All Done *'
%>
Link para o comentário
Compartilhar em outros sites
2 respostass a esta questão
Posts Recomendados