Devo scrivere questa istruzione:
if campo A del db è vuoto then
else
response.redirect errore.htm
Il mio problema è come controllare uno specifico campo del recordset
grazie
Devo scrivere questa istruzione:
if campo A del db è vuoto then
else
response.redirect errore.htm
Il mio problema è come controllare uno specifico campo del recordset
grazie
Puoi farlo direttamente nella query oppure dopo...
Come è fatta la tua query?
Per interrogare uno specifico campo basta indicarne il nome...
Roby
www.creamweb.it [v. 3.0]
:: Script ASP!
:: Web directory gratuita!
:: Campioni del mondo!
io vorrei fare il controllo dopo la query
sql = "SELECT * FROM tblCensimento WHERE nomeutente='" &nome_ut&_
"' AND password='" &pass& "'"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open sql, conn ,3,3
IN QUESTO PUNTO vorreicontrollare che il campo nel DB "controllonome" sia vuoto (per l'utente che si è loggato), e se la condizione è vera scrivere le informazioni nel db, altrimenti puntare ad una pagina che avvisa l'utente che i dati sono già stati inseriti
' Preparazione e scrittura nuovo record
rs(1) = strPostiRic
rs(2) = strPostiDay
rs(3) = strCamereBagno
rs(4) = strRapLettiBagni
rs(5) = strDegenzaMedia
rs(6) = strPercOnco
rs(7) = strPatOnco
rs(8) = strLeucAcute
rs(9) = strCamereSterili
rs(10) = strAuto
rs(11) = strHlaIdentico
rs(12) = strMud
rs(13) = strAplo
rs(14) = strCord
rs(15) = strPulsLab
rs(16) = strPulsRad
rs(17) = strPulsMedN
rs(18) = strPulsTrasf
rs(19) = strPulsTc
rs(20) = strPulsRmn
rs(21) = strPulsPet
rs(22) = strControlloNome
rs.update
'Chiusura del database
rs.Close
set rs = Nothing
conn.Close
set conn = Nothing
%>
Grazie per l'aiuto
codice:sql = "SELECT * FROM tblCensimento WHERE nomeutente='" &nome_ut&_ "' AND password='" &pass& "'" Set rs = Server.CreateObject("ADODB.Recordset") rs.Open sql, conn ,3,3 if not rs.EOF then if rs("controllonome")="" orIsNull(rs("controllonome")) then conn.close set conn=nothing response.redirect("errore.htm") else ' Preparazione e scrittura nuovo record rs(1) = strPostiRic rs(2) = strPostiDay rs(3) = strCamereBagno rs(4) = strRapLettiBagni rs(5) = strDegenzaMedia rs(6) = strPercOnco rs(7) = strPatOnco rs(8) = strLeucAcute rs(9) = strCamereSterili rs(10) = strAuto rs(11) = strHlaIdentico rs(12) = strMud rs(13) = strAplo rs(14) = strCord rs(15) = strPulsLab rs(16) = strPulsRad rs(17) = strPulsMedN rs(18) = strPulsTrasf rs(19) = strPulsTc rs(20) = strPulsRmn rs(21) = strPulsPet rs(22) = strControlloNome rs.update end if 'Chiusura del database rs.Close set rs = Nothing end if conn.Close set conn = Nothing %>
www.creamweb.it [v. 3.0]
:: Script ASP!
:: Web directory gratuita!
:: Campioni del mondo!
grazie, mi stava vendendo il mal di testa