Got a code snippet to work by modifying a module from Chapter 2 in
"Programming MS Access 2002". Didn't realize that the recordset string had
to be an SQL statement like SELECT rather than a table or view name:
Sub OpenMyDB()
Dim cnn1 As New Connection
Dim rst1 As Recordset
'Create the connection.
cnn1.Open "DSN=PostgreSQL30;" & _
"Database=test;"
'Create recordset reference, and set its properties.
Set rst1 = New ADODB.Recordset
rst1.CursorType = adOpenKeyset
rst1.LockType = adLockOptimistic
'Open recordset, and print a test record.
rst1.Open "select * from public.stores;", cnn1
Debug.Print rst1.Fields(0).Value, rst1.Fields(1).Value,
rst1.Fields(2).Value; rst1.Fields(3).Value; rst1.Fields(4).Value;
'Clean up objects.
rst1.Close
cnn1.Close
Set rst1 = Nothing
Set cnn1 = Nothing
End Sub