1 Customize a table to make it uploaded from the database:
<% Set = server.createObject ("adoDb.recordset")
Rs.open "SELECT * from AD ORDER BY BS", CONN, 1, 1
Do While Not Rs.eof
Response.write "
"
rs.movenext
loop
Rs.close
SET RS = Nothing
%>
Note: "WordLink" is a field name inside.
2 Connecting the database generally use this statement:
The conn.asp code is as follows:
<% @ Codepage = "936"%> // This sentence can be done
<%
DIM Conn
DIM ConnStr
DIM DB
DB = "db / my.mdb"
Set conn = server.createObject ("adoDb.connection")
Connstr = "provider = microsoft.jet.Oledb.4.0; data source =" & server.mappath (db)
Conn.open connStr
Startime = Timer ()
%>
3 For example: The page adds a message is added: (subsequent file name is tianjia.asp)
<%
SET RS = Server.createObject ("AdoDb.Recordset")
Name = Request ("name")
Mail = Request ("email")
Face = Request ("face")
SQL = "SELECT * from Message" (Message is a table name)
RS.Open SQL, CONN, 3, 3
rs.addnew
RS ("a_name") = name
RS ("a_mail") = mail
RS ("Face" = Face // This is the selected image, you can use image / 1.jpg in the field of the database table.
Rs.Update
Rs.close
Response.Redirect "xianshi.asp" // This sentence is a redirected page, that is, jump to xianshi.asp
%>
<%
SET RS = Nothing
Conn.close
Set conn = Nothing
%>
When you write this statement: