Read record
It is a bit boring today to learn, but it is very important. Here everyone don't need to know the specific operation of the order. The reason why many books outside is not suitable for entry is because of the introduction of too many theoretical knowledge, so that beginners foggy.
Let's see the mountain, look at two sentences:
<%
Set conn = server.createObject ("adoDb.connection")
Conn.open "driver = {Microsoft Access Driver (* .mdb)}; dbq =" & Server.mappath ("eXample3.mdb")
%>
The first sentence defines an AdoDB
Database Connectivity
Component, the second sentence is connected
Database, everyone will modify the back
The database name is OK. Is not it simple?
Let's see three sentences below:
<%
EXEC = "Select * from guestbook"
SET RS = Server.createObject ("AdoDb.Recordset")
Rs.Open Exec, CONN, 1, 1
%>
These three sentences are added behind the previous sentences, the first sentence: set the inquiry
The database command, SELECT is added to the field, if you have to query, use *, from the back of the table, what is the first to build a Gustbook table? The second sentence: Define a record set
Components, all searched records are placed here, the third sentence is to open this recordset, and EXEC is the query command that the previous definition is, CONN is the front definition.
Database Connectivity
Components, back parameters "1, 1", this is read, then the modification record sets the parameters to 1, 3, and then we read the record.