docs:programming:office_vba:adodb_recordset

ADODB.Recordset

Typical code to connect and list field names in a table:

Public Sub ListFields()
	Dim rst As ADODB.Recordset
	Dim fld As ADODB.Field

	Set rst = New ADODB.Recordset
	rst.Open "tblCustomers", CurrentProject.Connection
	For Each fld In rst.Fields
		Debug.Print fld.Name
	Next fld
	rst.Close
	Set fld = Nothing
	Set rst = Nothing
End Sub
  • docs/programming/office_vba/adodb_recordset.txt
  • Last modified: 2008/08/03 00:25
  • by 127.0.0.1