Allora ho creato la pagina dove prelevo i dati:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%
response.expires=-1
Dim rsWords
Dim rsWords_numRows
Dim q
Dim b
Dim hint
q=ucase(request.querystring("q"))
b=(request.querystring("b"))
f=(request.querystring("f"))
a=(request.querystring("a"))
hint=""
Set rsWords = Server.CreateObject("ADODB.Recordset")
rsWords.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("utenti.mdb")
rsWords.Source = "SELECT referente,ditta,sede,recapito FROM tabella WHERE (sede LIKE'" + q + "%') ORDER BY referente ASC"
rsWords.CursorType = 2
rsWords.CursorLocation = 2
rsWords.LockType = 3
rsWords.Open()
rsWords_numRows = 0
If Not rsWords.EOF Then
Do While Not rsWords.EOF
If trim(hint) = "" Then
hint = "<a href=""javascript:setTextBox('" & rsWords("sede") & "','" & b & "','" & f & "','" & a & "');"">" & rsWords("sede") & "</a>"
Else
hint = hint & " , <a href=""javascript:setTextBox('" & rsWords("sede") & "','" & b & "','" & f & "','" & a & "');"">" & rsWords("sede") & "</a>"
End If
rsWords.MoveNext()
Loop
End If
if trim(hint)="" then
response.write("Nessun risultato")
else
response.write(hint)
end if
rsWords.Close()
Set rsWords = Nothing
%>
e quella con il "form":
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<html>
<head>
<script src="clienthint.js"></script>
</head>
<body>
<%
'this displays the value of the textbox after the form is submitted
If trim(Request("txt1")) <> "" Then
Response.Write "You entered:"
Response.Write "<b>" & Request("txt1") & "</b><br /><br />"
End If
%>
<form name="form1" action="clienthint.asp" method="post">
Enter Word:
<input type="text" name="txt1" id="txt1" onKeyUp="showHint(this.value,'txt1','form1',true)">
<input type="submit" name="submit" value="submit">
</form>
<p>Suggestions: <span id="txtHint"></span></p>
</body>
</html>
Non ricordo bene come fare a prelevare un intero recordset invece delle singole query,in pratica quando cerco una voce vera tra referente,ditta,sede,recapito mi deve visualizzare tutte e 4 le voci e non solo quella che cerco. Come devo fare?