Skip to main content

Access VBA Connection String

Make sure to include the ADO 2.1 References 


This is the command to establish a connection to the current Access database in VBA.



Set conn = CurrentProject.Connection

Set objRec = New ADODB.Recordset

Read Only Connection:
objRec1.Open strSQL, conn


Write Connection: 



objRec2.Open strSQL, conn, adOpenForwardOnly, adLockOptimistic

Comments

Popular posts from this blog