ok, risolto così:
codice:
<%
addURL = Request.QueryString( "AddURL" )
addTitle = Request.QueryString( "AddTitle" )
addDescription = Request.QueryString( "AddDescription" )
addKeywords = Request.QueryString( "AddKeywords" )
' Return if not all data entered
If addTitle = "" or addURL = "" or addDescription = "" Then
Response.Redirect( "addpage.asp" )
End If
Session.timeout = 2
Set conn = Server.CreateObject("ADODB.Connection")
openStr = "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.Mappath("/mdb-database/SiteSearch.mdb")
conn.Open openStr
' setup strSQL
strSQL = "SELECT * FROM URLIndex WHERE URL = '" &request("addURL")& "' "
Set objRs = Server.CreateObject("ADODB.Recordset")
objRs.Open strSQL, Conn, 3, 3
if not objRs.bof and not objRs.eof then
' Pagina esistente
Response.write ("<div align=center>")
Response.write ("<font size=2 color=midnightblue face=verdana>")
Response.write ("
")
Response.write ("<img src = ""senzasperanza.gif"">
")
Response.write ("Siamo spiacenti
La pagina web:
<font color=red>" & objRs("URL") & "</font>
risulta già registrata nel nostro database.
")
Response.Write ("
Verificare i dati inseriti.
</a>")
Response.write ("</font></div>
")
else
' Setup SQL
sql = "INSERT INTO [URLIndex] ( [URL], [Title], [Description], [Keywords] )"
sql = sql + "VALUES ( '" & addURL & "', '" & addTitle & "', '" & addDescription & "', '" & addKeywords & "' )"
' Execute the statement
conn.Execute sql
' Print the URL
Response.Write "
URL: " & addURL
' Print the Title
Response.Write "
Titolo: " & addTitle
' Print the Description
Response.Write "
Descrizione: " & addDescription
' Print the Keywords
Response.Write "
Keywords: " & addKeywords & "
"
' Print the SQL String
Response.Write "
SQL String : " & sql
Response.write "Registrazione eseguita con successo."
end if
%>