Forum 

Forum AspNuke.it - Il tuo Portale OpenSource in ASP

Problemi con un mod solo sulla candidate - Help

Autore Messaggio
acar

Esperto
Esperto
267 Discussioni



Profilo - acar
18 ottobre 2004 alle 08:43:43 Profilo - acarInvia un messaggio privato Rispondi quotando
Salve Staff, scrivo perchè dopo aver cambiato le connessioni al db mettendo quelle pool, che sono piu veloci un mod non mi funziona piu!!!

è un mod che da la lista dei pm letti e risposti, chiamato messagelist-inc.asp fatto per 1.2 ed io ho adattato alle prime versioni della 2.0 ma con la candidate non va più... :~(

dando uno sguardo al CODE sapete dirmi il perche???

<%
' ************************************************************************
' * ASP-Nuke: Free web portal in ASP *
' ************************************************************************
' * Copyright (c) 2002-2003 by Gaetan Bouveret (webmaster@asp-nuke.com) *
' * http://www.asp-nuke.com *
' * *
' * This program is free software. You can redistribute it and/or modify *
' * it under the terms of the GNU General Public License as published by *
' * the Free Software Foundation; either version 2 of the License, or *
' * (at your option) any later version. *
' * *
' * Modifiche eseguite da Andrea & Cristiano *
' * Support: http://www.cristiano.risorse.com *
' ************************************************************************
'
' ************************************************************************
' Autore: Francesco Iafulli
' Data: 17 Febbraio 2003
' Sito: http://www.iafulli.net
' EMail: webmaster@iafulli.net
' ___________________________________________________
' Rivisto e adattato per la versione Asp-Nuke 1.2 da:
' Andrea e Cristiano http://www.cristiano.risorse.com

' Rivisto e adattato per Asp-Nuke 2.0 da Federico Luzi (Acar) acar@sebbeccamo.it www.sebbeccamo.it
' ************************************************************************
%>
<%
Dim oCnMain
Set oCnMain = DBConnexion(DB_MAIN)

CONST MAX_PMSG_ROWS_PER_PAGE = 20

' DisplayPMsgListPage
' Mostra la pagina
' input:
' nessuno
' output:
' nessuno
sub DisplayPMsgListPage()
dim OB, Dir, Page

OB = Request("OB")
if OB <> "" then
OB = CInt(OB)
else
OB = -1
end if

Page = Request("Page")
if Page <> "" then
Page = CInt(Page)
else
Page = 1
end if

Dir = (Request("Dir") = "")
DisplayPMsgListPrePage

DisplayPMessagesListPage OB, Dir, Page

end sub


' DisplayPMessagesListPage
' Mostra l'elenco dei messaggi
' input:
' sortBy -> ordinamento
' Direction -> ordinamento crescente/decrescente
' Page -> pagina da mostrare
' output:
' nessuno
Sub DisplayPMessagesListPage(sortBy, Direction, Page)
Dim oRs, rSQL, iLine, OB, plus, iNbTotalPosts, X, I


if not Direction then plus = " DESC"
Select case sortBy
case 0: OB = " ORDER BY mlDate" & plus ' x data
case 1: OB = " ORDER BY mlFrom" & plus & ", mlTo" & plus ' x Da/A
case 2: OB = " ORDER BY mlSubject" & plus ' x Oggetto
case 3: OB = " ORDER BY mlRead" & plus ' x letto
case 4: OB = " ORDER BY mlReply" & plus ' x risposto
case 5: OB = " ORDER BY mlRead" & plus & ", mlReply" & plus ' x letto/risposto
case else
OB = ""
end select

rSQL = "SELECT * FROM MessagesList WHERE mlFrom=" & SQLStr(spseudo) & " OR mlTo=" & SQLStr(spseudo) & OB

' Set oCn = DBConnexion(DB_MAIN)

Set oRS = Server.CreateObject("ADODB.Recordset")
oRs.PageSize = MAX_PMSG_ROWS_PER_PAGE
oRS.open rSQL, oCnMain, 1
iNbTotalPosts = oRs.RecordCount

if not oRs is nothing then
if not oRS.eof and not oRS.bof then

If oRs.RecordCount <> - 1 Then
oRs.AbsolutePage = Page
Else
For X = 1 To (Page-1)*MAX_PMSG_ROWS_PER_PAGE
oRs.MoveNext
Next
End If
end if
end if

CreateTopTable "PMessages list", GetTranslation ("LANG_PMSGLIST")
Response.Write "<table width=""100%"" class=""myTable"">"

DrawPMsgListHeader

iLine = 1
if not oRS is nothing then
if not oRs.eof and not oRS.bof then
If Not oRs.EOF Then
iLine = 1
For I = 1 to MAX_PMSG_ROWS_PER_PAGE
if not oRS.eof then
DrawPMsgListRecord oRS, iLine

oRs.MoveNext
iLine = ((iLine - 1) XOr 1) + 1
end if
Next

DisplayPMsgListPageRules oRS.RecordCount, MAX_PMSG_ROWS_PER_PAGE, Page, 7, SortBy, Direction
end if
end if
end if

Response.Write "</tr>"
Response.Write "</table>"
CreateBottomTable ""

%><p><br></p><%
Response.Write "<table width=""100%"" class=""myTable""><tr class=""tablemain""><td align=""center"">"
Response.Write "<a href=""" & GLOBAL_SITE_PATH & "pmessages.asp"">" & GetTranslation ("LANG_PRIVATE_RETURN_MP") & "</a>"
Response.Write "</table>" & vbCRLF





' oCn.Close
' Set oCn = Nothing
Set oRs = Nothing
End Sub

' DrawPMsgListRecord
' Mostra il singolo messaggio
' input
' RS -> record da mostrare
' iLine -> stile della riga della tabella
' output:
' nessuno
sub DrawPMsgListRecord (RS, iLine)
Response.Write " <tr class=""tableline" & iLine & """>" & vbCRLF
Response.Write " <td valign=""top"">" & PMsgListFormattaData (RS("mlDate") & "") & "</td>"
Response.Write " <td valign=""top"">" & RS("mlFrom") & "" & "</td>"
Response.Write " <td valign=""top"">" & RS("mlTo") & "" & "</td>"
Response.Write " <td valign=""top"">" & RS("mlSubject") & "" & "</td>"
Response.Write " <td valign=""top"">" & CodeMessage(RS("mlContent") & "", false) & "</td>"
Response.Write " <td align=""center"" valign=""top"">" & PMsgListSiNo(RS("mlRead")) & "</td>"
Response.Write " <td align=""center"" valign=""top"">" & PMsgListSiNo(RS("mlReply")) & "</td>"
Response.Write " </tr>" & vbCRLF
end sub

' DrawPMsgListHeader
' Mostra l'intestazione della tabella
' input:
' nessuno
' output:
' nessuno
sub DrawPMsgListHeader ()
Response.Write " <tr class=""tablemain"">" & vbCRLF
Response.Write " <td>" & GetTranslation ("LANG_PMSGLIST_FIELD_DATA") & "</td>"
Response.Write " <td>" & GetTranslation ("LANG_PMSGLIST_FIELD_A") & "</td>"
Response.Write " <td>" & GetTranslation ("LANG_PMSGLIST_FIELD_DA") & "</td>"
Response.Write " <td>" & GetTranslation ("LANG_PMSGLIST_FIELD_OGGETTO") & "</td>"
Response.Write " <td>" & GetTranslation ("LANG_PMSGLIST_FIELD_TESTO") & "</td>"
Response.Write " <td>" & GetTranslation ("LANG_PMSGLIST_FIELD_LETTO") & "</td>"
Response.Write " <td>" & GetTranslation ("LANG_PMSGLIST_FIELD_RISPOSTO") & "</td>"
Response.Write " </tr>" & vbCRLF
end sub

' PMsgListSiNo
' Ritorna Si o No al posto di true/false
' input:
' B -> valore da testare
' output:
' -> Stringa contenente Si o No
function PMsgListSiNo(B)
if B then PMsgListSiNo = GetTranslation ("LANG_PMSGLIST_SI") else PMsgListSiNo = GetTranslation ("LANG_PMSGLIST_NO")
end function

' PMsgListFormattaData
' Formatta la data
' input:
' S -> stringa contenente la data
' output:
' -> stringa contenente la data formattata
function PMsgListFormattaData (S)
dim X
X = mid(S,7,2) & "/"
X = X & mid (S,5,2) & "/"
X = X & left(s,4) & " - "
X = X & mid(S,10,2) & ":"
X = X & mid(S,13,2) & ":"
X = X & Right(S, 2)
PMsgListFormattaData = X
end function

' DisplayPMsgListPrePage
' Mostra il menu di ordinamento
' input:
' nessuno
' output:
' nessuno
sub DisplayPMsgListPrePage()

Response.Write "<table width=""100%"" class=""myTable""><tr class=""tablemain""><td align=""center"">"
Response.Write "<a href=""" & GLOBAL_SITE_PATH & "pmessages.asp"">" & GetTranslation ("LANG_PRIVATE_RETURN_MP") & "</a>"
Response.Write "</table>" & vbCRLF

%><p><br></p><%


CreateTopTable "PMessageList Commands", GetTranslation ("LANG_PMSGLIST_COMMANDS")
Response.Write "<table width=""100%"" class=""myTable""><tr class=""tablemain""><td align=""center"">"
Response.Write "<a href=""" & GLOBAL_SITE_PATH & "pmsglist.asp?ob=0"">" & GetTranslation ("LANG_PMSGLIST_ORDERBY_DATA") & "</a><br>"
Response.Write "<a href=""" & GLOBAL_SITE_PATH & "pmsglist.asp?ob=0&dir=1"">" & GetTranslation ("LANG_PMSGLIST_ORDERBY_DATA_DESC") & "</a>"
Response.Write "</td><td align=""center"">"
Response.Write "<a href=""" & GLOBAL_SITE_PATH & "pmsglist.asp?ob=1"">" & GetTranslation ("LANG_PMSGLIST_ORDERBY_DAA") & "</a><br>"
Response.Write "<a href=""" & GLOBAL_SITE_PATH & "pmsglist.asp?ob=1&dir=1"">" & GetTranslation ("LANG_PMSGLIST_ORDERBY_DAA_DESC") & "</a>"
Response.Write "</td><td align=""center"">"
Response.Write "<a href=""" & GLOBAL_SITE_PATH & "pmsglist.asp?ob=2"">" & GetTranslation ("LANG_PMSGLIST_ORDERBY_OGGETTO") & "</a><br>"
Response.Write "<a href=""" & GLOBAL_SITE_PATH & "pmsglist.asp?ob=2&dir=1"">" & GetTranslation ("LANG_PMSGLIST_ORDERBY_OGGETTO_DESC") & "</a>"

Response.Write "</td></tr><tr class=""tablemain""><td colspan=""3""> </td></tr><tr class=""tablemain""><td align=""center"">"

Response.Write "<a href=""" & GLOBAL_SITE_PATH & "pmsglist.asp?ob=3"">" & GetTranslation ("LANG_PMSGLIST_ORDERBY_LETTO") & "</a><br>"
Response.Write "<a href=""" & GLOBAL_SITE_PATH & "pmsglist.asp?ob=3&dir=1"">" & GetTranslation ("LANG_PMSGLIST_ORDERBY_LETTO_DESC") & "</a>"
Response.Write "</td><td align=""center"">"
Response.Write "<a href=""" & GLOBAL_SITE_PATH & "pmsglist.asp?ob=4"">" & GetTranslation ("LANG_PMSGLIST_ORDERBY_RISPOSTO") & "</a><br>"
Response.Write "<a href=""" & GLOBAL_SITE_PATH & "pmsglist.asp?ob=4&dir=1"">" & GetTranslation ("LANG_PMSGLIST_ORDERBY_RISPOSTO_DESC") & "</a>"
Response.Write "</td><td align=""center"">"
Response.Write "<a href=""" & GLOBAL_SITE_PATH & "pmsglist.asp?ob=5"">" & GetTranslation ("LANG_PMSGLIST_ORDERBY_LR") & "</a><br>"
Response.Write "<a href=""" & GLOBAL_SITE_PATH & "pmsglist.asp?ob=5&dir=1"">" & GetTranslation ("LANG_PMSGLIST_ORDERBY_LR_DESC") & "</a>"
Response.Write "</td></tr></table>"
CreateBottomTable ""
end sub

' DisplayPMsgListPageRules
' disegna il righello in basso alla pagina per la paginazione delle righe della tabella
' input:
' Totalepc -> numero totale dei record presenti nella lista
' PageLen -> lunghezza della pagina
' Pagina -> Numero della pagina visualizzata
' ColsPan -> Quale colspanning usare per la riga del righello
' ob -> ordinamento
' dir -> ordinamento crescente/decrescente
' output:
' nessuno
sub DisplayPMsgListPageRules(Totalepc, PageLen, Pagina, ColsPan, ob, dir)
Dim PagineTotali, X
if Totalepc < 0 then Totalepc = 0
PagineTotali = 0
if Totalepc > 0 then
PagineTotali = TotalepcPageLen
If Totalepc Mod PageLen Then PagineTotali = PagineTotali + 1
end if
If PagineTotali > 1 Then
Response.Write " <tr class=""tablelinemain"">" & vbCRLF
Response.Write " <td align=""center"" colspan=""" & Colspan & """>" & vbCRLF
If Pagina <> 1 Then Response.Write "  <a href=""" & GLOBAL_SITE_PATH & "pmsglist.asp?ob=" & ob & "&dir=" & dir & "&page=" & Pagina-1 & """><<</a>" & vbCRLF
For X = 1 To PagineTotali
If X <> CInt(Pagina) Then
Response.Write "  <a href=""" & GLOBAL_SITE_PATH & "pmsglist.asp?ob=" & ob & "&dir=" & dir & "&page=" & X & """>" & X & "</a>" & vbCRLF
Else
Response.Write " <b>" & X & "</b>" & vbCRLF
End If
Next
If Pagina <> PagineTotali Then Response.Write "  <a href=""" & GLOBAL_SITE_PATH & "pmsglist.asp?ob=" & ob & "&dir=" & dir & "&page=" & Pagina+1 & """>>></a>" & vbCRLF
Response.Write " </td>" & vbCRLF
Response.Write " </tr>" & vbCRLF


End If

end sub



%>


e questo è l'errore che da explorer:

ADODB.Recordset error '800a0bb9'

Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.

/includes/pMessageslist-inc.asp, line 96

---------------
http://www.pc-sapiens.net
emu

Moderatore

Esperto
Esperto
1714 Discussioni



Profilo - emu
18 ottobre 2004 alle 09:05:36 Profilo - emuInvia un messaggio privato Rispondi quotando
Nel file modifiche_it.txt del pacchetto Aspnuke 2.0.3 c'e' la spiegazione:

Introdotto uso pool di connessioni al DB
Modificata funzione DBConnexion per utilizzare sempre la stessa connessione, utilizzabile come parametro solo nelle funzioni standard di Aspnuke 2.0 relative ai DB
Introdotta funzione DBTrueConnexion che restituisce una connessione standard, non appartenente al pool

Quindi, visto che nel tuo codice usi la connesione come parametro per aprire un recordset SENZA usare le funzioni di aspnuke, devi creare la connessione oCnMain usando la funzione DBTrueConnexion.

Ciao
---------------
development@aspnuke.it
acar

Esperto
Esperto
267 Discussioni



Profilo - acar
18 ottobre 2004 alle 09:29:31 Profilo - acarInvia un messaggio privato Rispondi quotando
hemmm come si fa???

Ora vedo un pò da solo e se è il caso vi scoccio ancora!

Ciao ciao e grazie
---------------
http://www.pc-sapiens.net
emu

Moderatore

Esperto
Esperto
1714 Discussioni



Profilo - emu
18 ottobre 2004 alle 09:51:02 Profilo - emuInvia un messaggio privato Rispondi quotando
Nella funzione DisplayPMessagesListPage ripristini la riga in cui crei la oCn cambiando la funzione usata da DBConnexion a DBTrueConnexion, dopodiche' usi sempre oCn e ripristini in fondo alla funzione le chiamate di chiusura della connessione oCn.
La oCnMain allora non serve piu' e la puoi eliminare.
Ciao
---------------
development@aspnuke.it
acar

Esperto
Esperto
267 Discussioni



Profilo - acar
18 ottobre 2004 alle 12:09:37 Profilo - acarInvia un messaggio privato Rispondi quotando
Ora lo faccio GRAZIE
---------------
http://www.pc-sapiens.net
acar

Esperto
Esperto
267 Discussioni



Profilo - acar
19 ottobre 2004 alle 08:46:33 Profilo - acarInvia un messaggio privato Rispondi quotando
ok tutto funziona ora!!!
non so perche hanno creato oCn fuori dalla sub e non l'hanno nemmeno chiuso!

Cmq Grazia per l'aiuto!


---------------
http://www.pc-sapiens.net
acar

Esperto
Esperto
267 Discussioni



Profilo - acar
19 ottobre 2004 alle 10:01:37 Profilo - acarInvia un messaggio privato Rispondi quotando
Modificato il 19 ottobre 2004 alle 10:27:46

Rimanendo nelle connessioni, io come gia ti ho detto tempo fa ho un aspnuke 2.0 portato alla 2.0.3 su alcuni aspetti

in tutti i file devo rinominare il DBConnexion in DBTrueConnexion????

e la chiusura la lascio cosi comè?

---------------
http://www.pc-sapiens.net
acar

Esperto
Esperto
267 Discussioni



Profilo - acar
21 ottobre 2004 alle 20:02:17 Profilo - acarInvia un messaggio privato Rispondi quotando
???
---------------
http://www.pc-sapiens.net
emu

Moderatore

Esperto
Esperto
1714 Discussioni



Profilo - emu
22 ottobre 2004 alle 06:36:03 Profilo - emuInvia un messaggio privato Rispondi quotando
No, solo se utilizzi la connessione creata come parametro in una funzione non di aspnuke (che quindi non usa il pool). Nello script che avevi postato, dovevi sostituirla solo in un caso, altrimenti perdi i vantaggi del pool.
Se vuoi sostituirla nei mod aggiuntivi per evitare di dover controllare tutto il codice, puoi farlo, non ci sono controindicazioni oltre al mancato miglioramento delle prestazioni.
---------------
development@aspnuke.it
acar

Esperto
Esperto
267 Discussioni



Profilo - acar
22 ottobre 2004 alle 09:08:46 Profilo - acarInvia un messaggio privato Rispondi quotando
Scusa se ti rompo ancora, ma vorrei capire bene il funzionamento di queste connessioni pool e come si implementano!

non mi serve a nulla avere un aspnuke molto veloce con dei mod lenti!

vorrei capire come far diventare veloci anche i mod e su ARUBA questa cosa mi serve come il Pane!
prima che me staccano il sito!

non c'è un tutorial? che spiega come creare o trasformare?

Ciao
---------------
http://www.pc-sapiens.net
 1  2  >>

Log in

Login
Password
Memorizza i tuoi dati:

Cerca

 

Sostieni AspNuke

Un piccolo gesto per aiutarci a mantenere AspNuke.it online

Promo

MusicWebItalia.it
Video Testi Traduzioni Spot Colonne sonore Accordi e Spartiti gratis.

Visitatori

Visitatori Correnti : 134
Membri : 0 offline Anna

Iscritti

 Utenti: 18940
Ultimo iscritto : glauco
Lista iscritti
Messaggi privati: 3373 Commenti: 2210 Immagini: 39 Downloads: 144 Articoli: 49 Pagine: 101 Siti web: 558 Notizie: 180 Sondaggi: 11 Preferiti: 5685296 Post sui forum: 51195 Libro degli ospiti: 4 Eventi: 7

Versioni

Temi