News

GioExtreme

Nuovo Utente
31 Mag 2003
2
0
0
Ciao raga....sn nuovo!!! Per il mio sito vorrei inserire le news...qualcuno potrebbe darmi il codice per favore.??? grazie

jan267, mi sembra di aver capito che ne avevi fatto 1....Io lo vorrei appunto applicalo su un DataBase (ACCESS)... se riesci a farmi sap qlcosa ti sarei davvero grato



CIAO A TUTTI !!!!:rolleyes: :confused:
 
Originally posted by admin
Ciao raga....sn nuovo!!! Per il mio sito vorrei inserire le news...qualcuno potrebbe darmi il codice per favore.??? grazie

jan267, mi sembra di aver capito che ne avevi fatto 1....Io lo vorrei appunto applicalo su un DataBase (ACCESS)... se riesci a farmi sap qlcosa ti sarei davvero grato



CIAO A TUTTI !!!!:rolleyes: :confused:

Fatti un giro nella sezione script di mrwebmaster: c'è quello di jan!
 
Ciao,
questo codice e` quello per la visualizzazione dei messaggi ed e` decisamente piu` pulito dell`altro!
Codice:
<%
Dim strNewsConn
Dim strNewsRs
Dim strNewsSql
Dim strAction
strAction=Request.QueryString("act")
Set strNewsConn = Server.CreateObject ("ADODB.Connection")
	strNewsConn.Open "Driver={Microsoft Access Driver (*.mdb)};dbq=" & Server.MapPath("mdb-database/news.mdb")
Set strNewsRs = Server.CreateObject("ADODB.Recordset")
	If (strAction<>"ShowNews") Then
		strNewsSql = "SELECT Top 5 news.messaggio, news.data FROM news ORDER BY id DESC"
	Else
		strNewsSql = "SELECT * FROM news ORDER BY id DESC"
	End If
	strNewsRs.Open strNewsSql, strNewsConn, 3, 3

Response.Write vbCrLf & "<table align=""center"" width=""417"" cellpadding=""0"" cellspacing=""0"" height=""19"">"
Do While NOT strNewsRs.EOF
	Response.Write vbCrLf & " <tr>"
	Response.Write vbCrLf & "  <td width=""10"" valign=""top""><li></td>"
	Response.Write vbCrLf & "  <td width=""398""><font face=""Verdana"" size=""1"" color=""#000099""><b>"&strNewsRs("data")&"</b></font>"
	Response.Write vbCrLf & "  <font face=""Verdana"" size=""1""> - "&strNewsRs("messaggio")&"</font></td>"
	Response.Write vbCrLf & " </tr>"
	strNewsRs.MoveNext
Loop
If (strAction<>"ShowNews") Then
	Response.Write vbCrLf & " <tr>"
	Response.Write vbCrLf & "  <td colspan=""2"" align=""center"">"
	Response.Write vbCrLf & " <a href=""?act=ShowNews""><font face=""Verdana"" size=""1""><br>Visualizza tutte le news »</font></a></td>"
	Response.Write vbCrLf & " </tr>"
End If
Response.Write vbCrLf & "</table>"
%>
 

Discussioni simili