ADO Tips & Tricks1) Connection Objecta)
Opening the Database
b)
Executing Commands
c)
Executing Queries
d)
Closing the Database
2) Recordset Objecta)
The Fields Collection
b)
Editing Records
3) Toolsa)
One Column Queries
b)
ComboBox Example
c)
One Row Queries
d)
Multi-Column Queries
e)
Getting Field Names
f)
ComboBox Example, 2
4) A Useful Examplea)
The SELECT Clause
b)
The WHERE Clause
c)
The Query
|
Multi-Column
Queries
The
Recordset object's GetRows method copies data from the Recordset into a
Variant array.
Public Function ExecuteMultiColumnQuery( _ByVal query As String) As VariantDim rs As ADODB.Recordset ' Execute the query.
Set rs = m_DBConnection.Execute(query, , adCmdText) ' Return the results.
ExecuteMultiColumnQuery = rs.GetRows() ' Close the Recordset.
rs.CloseEnd Function |