<% Public Function FixQuote(Source) 'Description: Force acceptance of single quotes (' ') within SQL string ' arguments. ' Syntax: FixQuote(SQL String) 'Pass: Source - Unformatted SQL string. 'Returns: Source - SQL string correctly formatted with single quotes ' in argument(s) ('') '------------------------------------------------------------------------ ' Date Developer Comments '02/18 Fixed multi-single quote routine. '*********************************************************************** Dim I Dim j Dim HoldString HoldString = Source While InStr(HoldString, "''") I = InStr(HoldString, "''") Select Case I Case 1: HoldString = Mid(HoldString, 2) Case Else: HoldString = Left(HoldString, I) & Mid(HoldString, I + 2) End Select Wend j = 0 I = InStr(HoldString, "'") While (I > 0) HoldString = Left(HoldString, I) & "'" & Mid(HoldString, I + 1) j = I + 2 I = InStr(j, HoldString, "'") Wend ' Chr(145) is another type of single quote I = InStr(HoldString, "‘") While (I > 0) HoldString = Left(HoldString, I) & "‘" & Mid(HoldString, I + 1) j = I + 2 I = InStr(j, HoldString, "‘") Wend ' Chr(146) is another type of single quote I = InStr(HoldString, "’") While (I > 0) HoldString = Left(HoldString, I) & "’" & Mid(HoldString, I + 1) j = I + 2 I = InStr(j, HoldString, "’") Wend ' Chr(180) is another type of single quote I = InStr(HoldString, "‘") While (I > 0) HoldString = Left(HoldString, I) & "‘" & Mid(HoldString, I + 1) j = I + 2 I = InStr(j, HoldString, "‘") Wend FixQuote = HoldString End Function %> <% Dim Rs Dim Myconn Dim Sqlstr Set Myconn = server.createobject("ADODB.Connection") Myconn.ConnectionString = "Driver={Mysql}; Server=localhost; " &_ "Database=nivas_cadastro; UID=nivas_alex; " &_ "PWD=alex" Myconn.Open Set RS = server.CreateObject("ADODB.Recordset") Sqlstr = "Select * from nivas_cadastro where Month(DataNascimento) = Month(now()) order by DataNascimento" RS.open Sqlstr, Myconn response.write "" IF Month(now()) = 1 then response.write "" End If IF Month(now()) = 2 then response.write "" End If IF Month(now()) = 3 then response.write "" End If IF Month(now()) = 4 then response.write "" End If IF Month(now()) = 5 then response.write "" End If IF Month(now()) = 6 then response.write "" End If IF Month(now()) = 7 then response.write "" End If IF Month(now()) = 8 then response.write "" End If IF Month(now()) = 9 then response.write "" End If IF Month(now()) = 10 then response.write "" End If IF Month(now()) = 11 then response.write "" End If IF Month(now()) = 12 then response.write "" End If 'loop through the recordset and generate table rows Do until RS.EOF response.write "" response.write "" response.write "" RS.MoveNext Loop RS.close Myconn.close set RS = nothing set Myconn = nothing %> <% Dim Rs2 Dim Myconn2 Dim Sqlstr2 Set Myconn2 = server.createobject("ADODB.Connection") Myconn2.ConnectionString = "Driver={Mysql}; Server=localhost; " &_ "Database=nivas_cadastro; UID=nivas_alex; " &_ "PWD=alex" Myconn2.Open Set RS2 = server.CreateObject("ADODB.Recordset") Sqlstr2 = "Select * from nivas_cadastro where Month(DataNascimentoZeq) = Month(now()) order by DataNascimentoZeq" RS2.open Sqlstr2, Myconn2 'loop through the recordset and generate table rows Do until RS2.EOF response.write "" response.write "" response.write "" RS2.MoveNext Loop RS2.close Myconn2.close set RS2 = nothing set Myconn2 = nothing response.write "
Aniversários - Mês de Janeiro
Aniversários - Mês de Fevereiro
Aniversários - Mês de Março
Aniversários - Mês de Abril
Aniversários - Mês de Maio
Aniversários - Mês de Junho
Aniversários - Mês de Julho
Aniversários - Mês de Agosto
Aniversários - Mês de Setembro
Aniversários - Mês de Outubro
Aniversários - Mês de Novembro
Aniversários - Mês de Dezembro
" & Day(RS.fields("DataNascimento").value)& "" response.write "" response.write "" & FixQuote(RS.fields("Nome").value) &"
(" & FixQuote(RS.fields("Cidade").value) &" - " & FixQuote(RS.fields("Estado").value) &")" &"
" & Day(RS2.fields("DataNascimentoZeq").value)& "" response.write "" response.write "" & FixQuote(RS2.fields("Zequinha").value) &"
(Zequinha do(a) " & FixQuote(RS2.fields("Nome").value) & ")
" %>

Parabéns!!!