Rafael
<%
Set Conn = Server.CreateObject("ADODB.Connection")
idurl= "58"
ahora = now()
fecha = FormatDateTime(ahora,2)
Conn.open "DSN=ThyssenExplotacion;uid=THYSSEN;pwd=THYSSEN"
SQL="Select * from GOTOURL where ID ="& idurl
set RS = Conn.execute(SQL)
set enlace=RS("enlace")
Response.Write(enlace)
SQL = "select * from GOTOURL_CONTADOR where IDGOTOURL="&idurl&" and FECHA ='" & fecha &"'"
set RS2=Conn.execute(SQL)
if RS2.EOF then
SQL =" insert into GOTOURL_CONTADOR (IDGOTOURL, FECHA, CONTADOR) values (" & idurl & ",'" &fecha& "'," & 1 &")"
else
co = RS2("CONTADOR")+1
SQL ="update GOTOURL_CONTADOR set CONTADOR=" &CO& " WHERE IDGOTOURL=" &idurl& " and FECHA='"&fecha&"'"
end if
Conn.execute(SQL)
RS.close
RS2.close
%>