Home > How-To Library > Database
Opens an ADO connection and recordset.
**************************************************************** * © 2007 CodeItBetter http://www.codeitbetter.com * * This notice MUST stay intact for legal use * **************************************************************** 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
If you would like to submit your code here please us. Do not forget to mention your name. We are always thankful to each and everyone of you who submitted their code here.