Foros del Web » Programando para Internet » ASP Clásico »

Base d datos en Brinkster

Estas en el tema de Base d datos en Brinkster en el foro de ASP Clásico en Foros del Web. Buenas encontré este código para hacer lo de la imagen del día: <% Option Explicit Dim strID,strThought,strPhoto,intCount %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> ...
  #1 (permalink)  
Antiguo 17/02/2002, 17:49
 
Fecha de Ingreso: diciembre-2001
Mensajes: 248
Antigüedad: 22 años, 5 meses
Puntos: 0
Base d datos en Brinkster

Buenas encontré este código para hacer lo de la imagen del día:
<% Option Explicit
Dim strID,strThought,strPhoto,intCount
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
<title>Photo / Thought for the Day</title>
</head>
<body bgcolor="#FFFFFF">
<%Dim intDays,intStart,rsSite,rsTopNumber,objConn
set objConn =server.createobject("ADODB.connection")
objConn.open "DSN=Photo"
set rsTopNumber=objConn.execute("select count(*) from tblPhoto")
intCount = rsTopNumber(0)
rsTopNumber.close

set rsTopNumber=Nothing
intDays = DatePart("y",now)

intStart = intdays Mod intCount
intStart = intStart + 1

Dim sqlSELsite,ObjRSSel

sqlSELsite = "SELECT fldID,fldThought,fldPhoto FROM tblPhoto WHERE fldID = '" & intStart & "'"
Set ObjRSSel = Server.CreateObject("ADODB.Recordset")
ObjRSSel.Open sqlSELsite,objConn

strID = ObjRSSel(0)
strThought = ObjRSSel(1)
strPhoto = ObjRSSel(2)

%>
<table width="170" border="0" cellpadding="1" cellspacing="0" bgcolor="#CC0000">
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="4" bgcolor="#FFFFFF">
<tr bgcolor="#FFCCCC" valign="top">
<td height="20" bgcolor="#CC0000">
<div align="center"><font face="Arial, Helvetica, sans-serif" color="#FFFFFF" size="2"><b><font face="Verdana, Arial, Helvetica, sans-serif" size="1">Photo/Thought
for the Day</font></b></font></div>
</td>
</tr>
  #2 (permalink)  
Antiguo 17/02/2002, 17:52
 
Fecha de Ingreso: diciembre-2001
Mensajes: 248
Antigüedad: 22 años, 5 meses
Puntos: 0
Re: Base d datos en Brinkster

<tr valign="top">
<td height="22"><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><%= strThought %></font></td>
</tr>
<tr valign="top">
<td height="22" align="center"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">©<a href="http://www.stylusinc.com">Stylusinc.com</a></font></td>
</tr>
</table>
</td>
</tr>
</table>
<% ObjRSSel.close
Set ObjRSSel = Nothing
Set objConn = Nothing

%>

Pues bien esto se conecta a una baase de datos pero he intentado poner la conexion de a cuerdo a como brinkster lo manda pero no lo he conseguido, alguien me puede ayudar??


Gracais
  #3 (permalink)  
Antiguo 18/02/2002, 00:01
 
Fecha de Ingreso: febrero-2002
Ubicación: Mi ASP Bunker
Mensajes: 397
Antigüedad: 22 años, 3 meses
Puntos: 1
Re: Base d datos en Brinkster

Estas intentando conectar al DNS=Photo y en Brinkster como en otros no podes, tenes que usar DSN-less.

Reemplaza la linea
objConn.open "DSN=Photo"
por estas 2 :

Set objConn = Server.CreateObject("ADODB.connection")

objConn.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("\TuSitio\db\basededatos.mdb&q uot;) & ";")

Suerte :)
  #4 (permalink)  
Antiguo 18/02/2002, 12:58
 
Fecha de Ingreso: diciembre-2001
Mensajes: 248
Antigüedad: 22 años, 5 meses
Puntos: 0
Re: Base d datos en Brinkster

Pos eso era lo que ya no daba hecho.


Muchisimas Gracias
  #5 (permalink)  
Antiguo 22/02/2002, 12:33
 
Fecha de Ingreso: diciembre-2001
Mensajes: 248
Antigüedad: 22 años, 5 meses
Puntos: 0
Re: Base d datos en Brinkster

Ya lo conecte y ahora intento hacer que en vez de cambiar la foto cada día lo haga cada semana, Como puedo hacerlo??




Muchas gracias
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 21:33.