WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

ADO Recordset


To have the capacity to peruse database information, the information should initially be stacked into a recordset. 


Create an ADO Table Recordset

After an ADO Database Connection has been made, as exhibited in the past section, it is conceivable to make an ADO Recordset.  

Suppose we have a database named "Northwind", we can gain admittance to the "Customers" table inside the database with the accompanying lines:

<%
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open "c:/webdata/northwind.mdb"

set rs=Server.CreateObject("ADODB.recordset")
rs.Open "Customers", conn
%>

Create an ADO SQL Recordset

We can likewise gain admittance to the information in the "Customers" table utilizing SQL:

<%
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open "c:/webdata/northwind.mdb"

set rs=Server.CreateObject("ADODB.recordset")
rs.Open "Select * from Customers", conn
%>

Extract Data from the Recordset

After a recordset is opened, we can remove information from recordset.  

Suppose we have a database named "Northwind", we can gain admittance to the "Customers" table inside the database with the accompanying lines:

<%
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open "c:/webdata/northwind.mdb"

set rs=Server.CreateObject("ADODB.recordset")
rs.Open "Select * from Customers", conn

for every x in rs.fields
  response.write(x.name)
  response.write(" = ")
  response.write(x.value)
next
%>