CreateDynaset Method Example

This example uses an SQL statement to create a read-only Dynaset of Publishers from New York.

Dim MyDB As Database, MySet As Dynaset
Dim MyTable As Table, SQLStmt As String
Const DB_READONLY = 4                      ' Set constant.
Set MyDB = OpenDatabase("BIBLIO.MDB")      ' Open database.
' Set text for the SQL statement.
SQLStmt = "SELECT * FROM Publishers WHERE State = 'NY'"
' Create the new Dynaset.
Set MySet = MyDB.CreateDynaset(SQLStmt, DB_READONLY)