<% sSQL="Select Count(*) as Conta from News Where Tipo= 'Attiva';" %>
con questa query conto i record della tabella news quando il campo tipo è attiva..ma come stampo a video il risulato??
<% sSQL="Select Count(*) as Conta from News Where Tipo= 'Attiva';" %>
con questa query conto i record della tabella news quando il campo tipo è attiva..ma come stampo a video il risulato??
Response.Write(RS("Conta"))Originariamente inviato da ffilogamo
<% sSQL="Select Count(*) as Conta from News Where Tipo= 'Attiva';" %>
con questa query conto i record della tabella news quando il campo tipo è attiva..ma come stampo a video il risulato??
ho fatto cosi:
<% sSQL="Select Count(ID) as Conta from News;"
objRS.Open sSQL, objConn, 3, 3
Set objRs = Server.createObject("ADODB.Recordset")
%>
<%
objRs.Open strSQL, objConn
%>
<%
Response.Write("Nel database sono presenti ")
%>
<%
Response.Write(objRs("Conta"))
Response.Write(" news in totale.")
%>
<%
objRs.Close
Set objRs = Nothing
%>
ma mi da errore
ADODB.Recordset error '800a0bb9'
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
Default.asp, line 140
prova cosìcodice:sSQL="Select Count(ID) as Conta from News" Set objRs = Server.createObject("ADODB.Recordset") objRS.Open sSQL, objConn, 3, 3 if not objRS.eof then Response.Write("Nel database sono presenti " & objRs("Conta") & " news in totale.") ) end if objRs.Close Set objRs = Nothing %>
Fero
Vuoi conoscere nuovi Amici?
VBScript runtime error '800a01a8'Originariamente inviato da fero
prova cosìcodice:sSQL="Select Count(ID) as Conta from News" Set objRs = Server.createObject("ADODB.Recordset") objRS.Open sSQL, objConn, 3, 3 if not objRS.eof then Response.Write("Nel database sono presenti " & objRs("Conta") & " news in totale.") ) end if objRs.Close Set objRs = Nothing %>
Object required
/turismo/default.asp, line 217