Ver Mensaje Individual
  #1 (permalink)  
Antiguo 04/10/2005, 06:33
Avatar de virla
virla
 
Fecha de Ingreso: julio-2002
Ubicación: Rio Gallegos - Santa Cruz
Mensajes: 893
Antigüedad: 22 años, 9 meses
Puntos: 1
ayuda con calendario dinamico

tengo un calendario dinamico pero necesito que en las fechas que se encuentan en la base de datos se ponga un link, lo he hecho pero no se porque me sale un error

Microsoft VBScript runtime error '800a01a8'

Object required

/calendario.asp, line 45

la linea 45 es esta
resNoticias.Open sqlNoticias, Con,3,1
Se que no necesariamente el error puede estar ahí.
aqui les dejo todo el codigo aver si alguno puede darme una mano con esto, plis. porque hace dias que estoy probando pero nada.

Código:
<%@ Language=VBScript %>
<%
	set Con = Server.CreateObject("ADODB.Connection")
	set resNoticias = Server.CreateObject("ADODB.RecordSet")
	Con.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("/xxxxx.mdb")
'pagina que recibirá la fecha seleccionada por el usuario
Const URLDestino = "index-ant.asp" 

'Declaramos las variables
Dim MiMes
Dim MiAnio
Dim PrimerDia
Dim DiaActual
Dim Col
Dim Fila
Dim Fet
Dim Fecha

MiMes = Request.Querystring("Month")
MiAnio = Request.Querystring("Year")

If IsEmpty(MiMes) then MiMes = Month(Date)
if IsEmpty(MiAnio) then MiAnio = Year(Date)

Call MustraTitulo (MiMes, MiAnio)

PrimerDia = WeekDay(DateSerial(MiAnio, MiMes, 1)) -1
DiaActual = 1
'Construyamos el calendario 
For Fila = 0 to 5
	For Col = 0 to 6
		If Fila = 0 and Col < PrimerDia then
			response.write "<td>&nbsp;</td>"
		elseif DiaActual > DiaAnterior(MiMes, MiAnio) then
			response.write "<td>&nbsp;</td>"
		else
			response.write "<td"
			if cInt(MiAnio) = Year(Date) and cInt(MiMes) = Month(Date) and DiaActual = Day(Date) then 
				response.write " class='calCeldaResaltado' align='center'>"
			else 
				response.write " align='center'>"
			end if
			Fet= DiaActual & "/" & MiMes & "/" & MiAnio
			sqlNoticias = "SELECT * FROM tbTapa WHERE fechaBase="&Fet&""
			resNoticias.Open sqlNoticias, Con,3,1
			if not resNoticias.eof and not resNoticias.bof then
				Fecha=resNoticias("fechaBase")
			end if
			if Fet = Fecha then 
				response.write "<a href='" & URLDestino & "?fecha=" & Fet & "'>"
			end if
			'Libera memoria
			resNoticias.Close
			Set resNoticias = Nothing
			if cInt(MiAnio) = Year(Date) and cInt(MiMes) = Month(Date) and DiaActual = Day(Date) then 
				Response.Write "<div class='calResaltado'>" 
			else
				Response.Write "<div class='calSimbolo'>" 
			end if
			Response.Write DiaActual & "</div></a></td>"
			DiaActual = DiaActual + 1
		End If
	Next
	response.write "</tr>"
Next
response.write "</table></body>"
%>

<script language="JavaScript">
<!--
//window.open = SymRealWinOpen;
//-->
</script>

<%
Sub MustraTitulo(MiMes,MiAnio)
%>
<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>
<style>
		.calFondoCalendario {background-color:#EFF4FA}
		.calEncabe {font-family:Arial, Helvetica, sans-serif; font-size:11px}
		.calFondoEncabe {background-color:#becfdf}
		.calDias {font-family:Arial, Helvetica, sans-serif; font-size:9px; font-weight:900; background-color: #becfdf}
		.calSimbolo {font-family:Arial, Helvetica, sans-serif; font-size:11px; text-decoration:none; font-weight:200; color:#666666}
		.calResaltado {font-family:Arial, Helvetica, sans-serif; font-size:11px; text-decoration:none; font-weight:700}
		.calCeldaResaltado {background-color:#becfdf}
		.calCeldaFlechas {background-color:#3C5A77}
		.calCeldaMesAnio {background-color:#4E789E}
		.calCeldaDomingo {font-family:Arial, Helvetica, sans-serif;font-size:9px;font-weight:900;background-color:#9c0031;color: #FFFFFF}
		.calColDomingo {font-family:Arial, Helvetica, sans-serif;font-size:9px;font-weight:900;background-color:#4E789E;color: #FFFFFF}
</style>
<title>Calendario AspectoX</title></head>
<body bgcolor='#FFFFFF' leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<div align="center">
<table border='0' cellspacing='1' cellpadding='0' width='200' align='center' class="calFondoCalendario" bgcolor="#003399"> 
	<tr align='center'> 
		<td colspan='7'>
    	<table border='0' cellspacing='1' cellpadding='1' width='100%' class="calFondoEncabe" bgcolor="#003399">
      		<tr>
				<td width="11" align='left' class='calCeldaFlechas'>
						<%
						response.write "<a href = 'calendario.asp?"
						if MiMes - 1 = 0 then 
							response.write "month=12&year=" & MiAnio -1
						else 
							response.write "month=" & MiMes - 1 & "&year=" & MiAnio
						end if
						response.write "'><span class='calSimbolo'><img height='11' src='img/skins/flechaIzq.gif' width='22' border='0'></span></a>"
						%></td>
					<td align='center' class='calCeldaMesAnio'>
						<%
						response.write "<span class='calEncabe'> <b>" & MonthName(MiMes) & "</b> </span>"
						%>
					</td>
					<td width="11" align='right' class='calCeldaFlechas'>
						<%
						response.write "<a href = 'calendario.asp?"
						if MiMes + 1 = 13 then 
							response.write "month=1&year=" & MiAnio + 1
						else 
							response.write "month=" & MiMes + 1 & "&year=" & MiAnio
						end if
						response.write "'><span class='calSimbolo'><img height='11' src='img/skins/flechaDer.gif' width='22' border='0'></span></a>"
						%>			  </td>
		  </tr>
		  </table>
	  </td>
	</tr>
	<tr align='center'> 
		<td><div class='calCeldaDomingo'>Dom</div></td>
		<td><div class='calDias'>Lun</div></td>
		<td><div class='calDias'>Mar</div></td>
		
  <td bgcolor="#dbe7f3">
<div class='calDias'>Mie</div></td>
		
  <td bgcolor="#dbe7f3">
<div class='calDias'>Jue</div></td>
		<td><div class='calDias'>Vie</div></td>
		<td><div class='calDias'>Sab</div></td>
	</tr>
    <%
End Sub

Function MonthName(MiMes)
	Select Case MiMes
		Case 01
			MonthName = "Enero"
		Case 02
			MonthName = "Febrero"
		Case 03
			MonthName = "Marzo"
		Case 04
			MonthName = "Abril"
		Case 05
			MonthName = "Mayo"
		Case 06
			MonthName = "Junio"
		Case 07
			MonthName = "Julio"
		Case 08
			MonthName = "Agosto"
		Case 09
			MonthName = "Septiembre"
		Case 10
			MonthName = "Octubre"
		Case 11
			MonthName = "Noviembre"
		Case 12
			MonthName = "Diciembre"
		Case Else
			MonthName = "ERROR!"
	End Select
End Function

Function DiaAnterior(MiMes, MiAnio)
	Select Case MiMes
		Case 01, 03, 05, 07, 08, 10, 12
			DiaAnterior = 31

		Case 04, 06, 09, 11
			DiaAnterior = 30

		Case 2
			If IsDate(MiAnio & "-" & MiMes & "-" & "29") Then DiaAnterior = 29 Else DiaAnterior = 28

		Case Else
			DiaAnterior = 0
	End Select
End Function
%>
<table border='0' cellspacing='1' cellpadding='1' width='200' class="calFondoEncabe" bgcolor="#003399">
      <tr class="calFondoEncabe" bgcolor="#003399">
        <td width="11" align='left' class='calCeldaFlechas'>
          <%
						response.write "<a href = 'calendario.asp?"
						if MiMes - 1 = 0 then 
							response.write "month=12&year=" & MiAnio -1
						else 
							response.write "month=" & MiMes - 1 & "&year=" & MiAnio
						end if
						response.write "'><span class='calSimbolo'><img height='11' src='img/skins/flechaIzq.gif' width='22' border='0'></span></a>"
						%></td>
        <td align='center' class='calCeldaMesAnio'>
						<%
						response.write "<span class='calEncabe'> <b>" & MiAnio & "</b> </span>"
						%>
		</td>
        <td width="11" align='right' class='calCeldaFlechas'>
		<%
						response.write "<a href = 'calendario.asp?"
						if MiMes + 1 = 13 then 
							response.write "month=1&year=" & MiAnio + 1
						else 
							response.write "month=" & MiMes + 1 & "&year=" & MiAnio
						end if
						response.write "'><span class='calSimbolo'><img height='11' src='img/skins/flechaDer.gif' width='22' border='0'></span></a>"
						%>
		</td>
      </tr>
</table>
otra cosa quisiera que en la columna de los dias domingos lleve otro color pero tambien he probado de todo pero nada.
espero puedan darme una mano con este codigo, desde ya muchas gracias
__________________
---->Sin ayuda no se llega a ningun lado<----
Virla