Recommended: ASP+AJAX search tips similar to Google The main files are: Index.html implementation function, a text box, input content and implement the prompt search.asp query function, let the content entered in the text box be queried in the database, and then return it to the client conn.asp database connection function, and realize the core part of the database connection with the database, which is used to pass the client's data to the server, and then the server's data.
<html><title>
</title>
<body>
<%
Functiongen_key(digits)
'Define and initialize the array
dimchar_array(80)
'Initialize the number
Fori=0To9
char_array(i)=CStr(i)
Next
'Initialize capital letters
Fori=10To35
char_array(i)=Chr(i+55)
Next
'Initialize lowercase letters
Fori=36To61
char_array(i)=Chr(i+61)
Next
RandomizeTimer 'Initializes the random number generator.
dowhilelen(output)<digits
num=char_array(Int((62-0+1)*Rnd+0))
output=output+num
loop
'Set the return value
gen_key=output
EndFunction
'Return the result to the browser
Response.write The thirteen-bit random string generated by this instance is:
response.write<center>
response.writegen_key(13)
response.write</center>
%>
</body>
</html>
Share: 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