Third, the first Test
In the first test, we simulated a typical scenario found in the Microsoft ASP ADO sample to extract a Recordset. In this example (ado__01.asp), we first open a connection and then create the Recordset object. Of course, the scripts here are optimized according to the coding rules summarized in the first part of this article.
<% Option Explicit% >
<!--#Include file= "Adovbs. INC "->
<%
Dim objconn
Dim objRS
Response.Write (_
"< HTML >< head >" & _
"< TITLE >ado test</title >" & _
")
Set objconn = Server.CreateObject ("ADODB. Connection ")
objConn.Open application ("Conn")
Set objRS = Server.CreateObject ("ADODB. Recordset ")
Objrs.activeconnection = objconn
Objrs.cursortype = adOpenForwardOnly
Objrs.locktype = adLockReadOnly
Objrs.open application ("SQL")
If objrs.eof Then
Response.Write ("No Records Found")
Else
' Write headings
Response.Write (_
"< TABLE border=1 >" & _
"< TR >" & _
"< TH >OrderID</th >" & _
"< TH >CustomerID</th >" & _
"< TH >EmployeeID</th >" & _
"< TH >OrderDate</th >" & _
"< TH >RequiredDate</th >" & _
"< TH >ShippedDate</th >" & _
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service