CodeItBetter Programming Another VB Programming Blog

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
Filed under: Database Leave a comment
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


 

No trackbacks yet.