Cita:
Iniciado por JuanRAPerez
toc toc
Esta línea esta como comentario en tu código
'rs.open SQL, conn
quitale el comentario y prueba
suerte
Muchas gracias
JuanRAPerez por tu interés.
Quizás con el código entero me podéis aconsejar mejor. Esa linea que me dices la tengo activada más arriba, mira.
Código asp:
Ver original<%
Set conn = Server.CreateObject("ADODB.Connection")
conn.open "PROVIDER=SQLOLEDB;DATA SOURCE=xxxxxxxxxx;UID=xxxxxxx;PWD=xxxx;DATABASE=incidencias"
'This code block will create a recordset
Set rs = Server.CreateObject("ADODB.Recordset")
SQL = "SELECT * FROM NSG_COMENTARIS_INCIDENCIES WHERE (creat_per = '12571') AND (YEAR(data) LIKE '2009') AND (DAY(data) LIKE '9') AND (MONTH(data) LIKE '12')"
rs.open SQL, conn
'will iterate to display the records got from the database
response.write("<table>")
'response.write("<thead>" & "<th>" & "ID_Comentari" & "</th>" & "<th>" & "ID_Incidencia" & "</th>" & "<th>" & "Data" & "</th>" & "<th>" & "Descripcio" & "</th>" & "<th>" & "Temps Dedicat" & "</th>" & "<th>" & "Creat Per" & "</th>" & "</thead>")
response.write("<thead>" & "<th>" & "ID_Comentari" & "</th>" & "<th>" & "ID_Incidencia" & "</th>" & "<th>" & "Data" & "</th>" & "<th>" & "Temps Dedicat" & "</th>" & "<th>" & "Creat Per" & "</th>" & "</thead>")
While Not rs.EOF
response.write("<tr>")
'response.write("<td>" & rs("id_comentari") & "</td>" & "<td>" & rs("id_incidencia") & "</td>" & "<td>" & rs("data") & "</td>" & "<td>" & rs("descripcio") & "</td>" & "<td>" & rs("temps_dedicat") & "</td>" & "<td>" & rs("creat_per") & "</td>")
response.write("<td>" & rs("id_comentari") & "</td>" & "<td>" & rs("id_incidencia") & "</td>" & "<td>" & rs("data") & "</td>" & "<td>" & rs("temps_dedicat") & "</td>" & "<td>" & rs("creat_per") & "</td>")
response.write("</tr>")
rs.MoveNext
Wend
response.write("</table>")
'closes the connection
rs.close
conn.close
Set rs = Nothing
Set conn = Nothing
'imprimo usuarios con sus tiempos
Set conn = Server.CreateObject("ADODB.Connection")
conn.open "PROVIDER=SQLOLEDB;DATA SOURCE=xxxxxxxxxx;UID=xxxxxxx;PWD=xxxx;DATABASE=incidencias"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.open SQL, conn
SQL = "SELECT SUM(temps_dedicat) AS tiempos FROM NSG_COMENTARIS_INCIDENCIES WHERE (creat_per = '12571') AND (YEAR(data) LIKE '2009') AND (DAY(data) LIKE '9') AND (MONTH(data) LIKE '12')"
'rs.open SQL, conn
'will iterate to display the records got from the database
response.write("<table>")
response.write("<thead>" & "<th>" & "Trabajador" & "</th>" & "<th>" & "Tiempo en Min." & "</th>" & "</thead>")
While Not rs.EOF
response.write("<tr>")
response.write("<td>" & "Dani" & "</td>" & "<td>" & rs("tiempos") & "</td>")
response.write("</tr>")
rs.MoveNext
Wend
response.write("</table>")
'closes the connection
rs.close
conn.close
Set rs = Nothing
Set conn = Nothing
%>
Muchas gracias de antemano!