Recommended: How to use Asp to get all table names and field names in the database % set rs=server.CreateObject(adodb.recordset) db= db.mdb 'Just change the database name directly and you can see the effect. set conn=server.CreateObject(adodb.connection) connstr=Provider=Microsoft.Jet.OLEDB.4.0;Data Source= Server.MapPath(db) conn.open c
The main documents are:Index.html implements functions, a text box, enters content and implements prompts
Search.asp query function, let the content entered in the text box be queried in the database, and then returned to the client
Conn.asp database connection function to realize connection with the database
The core part of xmlhttp.jsAJAX is used to pass the client's data to the server and then return the server's data to the client.
style.css style file, mainly styles the content queryed by Google prompt box, mainly styles the content queryed by Google
First look at the first file style.css
[code=css]
@charsetutf-8;
/*CSSDocument*/
Body
{
font-size:12px;
font-family:Arial,Helvetica,sans-serif;
}
#search_suggest
{
position:absolute;
background:#FFFFFF;
text-align:left;
border:1px#000000solid;
}
.suggest_link_over
{
background-color:#e8f2fe;
padding:2px6px;
}
.suggest_link
{
padding:2px6px;
background-color:#FFFFF;
}
.none
{
display:none;
}
[/code]
The second file: xmlhttp.js
[code=jscript]
//JavaScriptDocumentrt
varxmlHttp=createXmlHttpRequest();
functioncreateXmlHttpRequest()
{
varxmlhttp=null;
try
{
xmlhttp=XMLHttpRequest();
}
catch(e1)
{
try
{
xmlhttp=newActiveXObject(MSXML2.XMLHTTP);
}
catch(e2)
{
try
{
xmlhttp=newActiveXObject(Microsoft.XMLHTTP);
}
catch(e3)
{
xmlhttp=false;
alert(creation failed!);
}
}
}
Share: Asp reads text files and displays them html head http-equiv=Content-Type content=text/html; charset=gb2312 title/title /head body % LANGUAGE = VBScript % % Const ForReading = 1, ForWriting = 2, ForAppending = 8 Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse
3 pages in total Previous page 123 Next page