|
ADO stands for ActiveX Data Objects. ActiveX Data Objects are a collection of components that can be used in your ASP programs. ADO is used to communicate and manipulate a database. ADODB is comprised of 3 main objects: Connection, RecordSet, Command. The ADODB.Connection object opens up an ODBC or OLEDB connection to a database through database drivers so you can do something with the database.
<%
Dim objConn
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open = ("DRIVER={Microsoft Access Driver (*.mdb)};DBQ=c:\testing.mdb;")
Set rs = objConn.execute("SELECT * FROM users;")
DO WHILE NOT rs.EOF
Response.Write "NAME:" & rs(name) & "<BR>"
Response.Write "PHONE: & rs(phone) & "<BR>"
LOOP
objConn.Close()
Set objConn = nothing
%> |