Can anyone please explain this ASP program?

SpaceGirl

New member
There are few things I request you to explain in this program.
<%
dim conn, rec, r, n, a
set conn=Server.CreateObject("ADODB.Connection")
set rec=Server.CreateObject("ADODB.Recordset")
conn.Open"Provider=Microsoft.Jet.OLEDB.4.0;"& Data Source="& Server.MapPath("Sample.mdb")
r=Request.Form("rno")
n=Request.Form("name")
a=Request.Form("age")
If Not IsNumeric(r) then
response.write("Invalid roll no.")
elseif Not IsNumeric(a) then
response.write("Invalid age")
else
set rec=conn.Execute("select * from test where rollno="&r)
if Not rec.EOF then
response.write("roll num already exists")
else
conn.Execute("Insert into test values("&r&",'"&n&",'"&a&")"
response.write("record saved")
end if
end if
conn.close
%>
Now, first of all plz explain what these lines mean?
Server.CreateObject("ADODB.Connection")
Server.CreateObject("ADODB.Recordset")
what is meant by rec.EOF?
and what is conn.open?
 
Back
Top