Opens an ADO connection and recordset.
Posted on July 6, 2011
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | 'Database - Opens an ADO connection and recordset. Dim rst As ADODB.Recordset Dim conn As ADODB.Connection 'Set up connection Set conn = New ADODB.Connection conn.Provider = "Microsoft Jet 4.0 OLE DB Provider" conn.ConnectionString = "Data Source=C:\path\filename.mdb" conn.Open Set rst = New ADODB.Recorset rst.Open "TableName", conn, adOpenDynamic, adLockOptimistic, adCmdTable 'Perform necessary record operations rst.Close Set rst = Nothing 'Close the connection conn.Close Set conn = Nothing |