Ciao,
devo generare un tag title dinamico che cambia in funzione dedi dati che pesca dal db. La tabella del db contiene un campo ID e un campo Title.
Ho scritto questa funzione:
Function GeneraSchedaTitle(titoloschedaID)
Dim ConnObj, RecordTitoloScheda
if titoloschedaID <> "" then
Set ConnObj = Server.CreateObject("ADODB.Connection")
ConnObj.Open MyConnStr
SQL = "SELECT Title FROM tabella WHERE tabella.ID = " & titoloschedaID
if Debug = True then response.write SQL
Set RecordTitoloScheda = ConnObj.Execute(SQL)
If RecordTitoloScheda.EOF then
GeneraSchedaTitle = ""
else
if RecordTitoloScheda("Title") <> 0 then
GeneraSchedaTitle RecordTitoloScheda("Title")
end if
if RecordTitoloScheda("Title") <> 0 then
TitleText = TitleText & " "
end if
TitleText = TitleText & RecordTitoloScheda("Title")
GeneraSchedaTitle = TitleText & " "
end if
ConnObj.Close
Set RecordTitoloScheda = Nothing
else
GeneraSchedaTitle = " "
end if
End Function
Poi la inserisco nel tag title:
<title>Titolo: <% = GeneraSchedaTitle(ID) %></title>
Ma non mi compare nienete se non Title:
Sembra che no riesce a pescare il valore Title.
Non riesco a capire dove sbaglio.
Qualcuno ha voglia di darmi un suggerimento ?
Grazie

Rispondi quotando