Ciao a tutti,
Ho un form in asp che invia i dati inseriti in un database access, funziona tutto, ma vorrei inplementargli la funzione controlla dati inseriti, cioè se un utente inserisce lo stesso dato nel campo link, venga rilanciato l'errore.
in rete ho trovato questo codice, ma non funziona, nel preciso mi da SYNTAX ERROR alla lettera &..
code:
<% ' *** Check New Elements
FX_flag="MM_insert"
FX_rs = "" ' used for identification
FX_found = false
If (CStr(Request(FX_flag)) <> "") Then
FX_dupKeyRedirect="esiste_atleta.asp"
FX_rsKeyConnection=MM_ConnUtentiAmm_STRING
FX_dupKeyValue = CStr(Request.Form("Link"))
FX_dupKeySQL="SELECT cadLink FROM tblQCAds WHERE cadLink = '" &
FX_dupKeyValue & "'AND '" & FX_dupKeyValue2 & "'"
FX_adodbRecordset="ADODB.Recordset"
set FX_rsKey=Server.CreateObject(FX_adodbRecordset)
FX_rsKey.ActiveConnection=FX_rsKeyConnection
FX_rsKey.Source=FX_dupKeySQL
FX_rsKey.CursorType=0
FX_rsKey.CursorLocation=2
FX_rsKey.LockType=3
FX_rsKey.Open
If ((Not FX_rsKey.EOF Or Not FX_rsKey.BOF)) Then
' this value was found - can not execute action
FX_found = true
FX_dupValue = "NomeAtleta (" & FX_dupKeyValue & ") " &
"CognomeAtleta (" & FX_dupKeyValue2 & ") "
End If
if(FX_found) Then
FX_dupValue = FX_dupValue & "already exists!"
FX_qsChar = "?"
If (InStr(1,FX_dupKeyRedirect,"?") >= 1) Then FX_qsChar = "&"
FX_dupKeyRedirect = FX_dupKeyRedirect & FX_qsChar & "FX_ReqValue="
& Server.URLEncode(FX_dupValue)
Response.Redirect(FX_dupKeyRedirect)
End If
FX_rsKey.Close
End If
%>
<%
Session("FX_checkvalue") = ""
Session("FX_checkvalue2") = ""
%>
potete aiutarmi?? o consigliarmi un'altro codice?
grazie

Rispondi quotando
