How to Open MS Access File

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Using VBA, how do I open a Microsoft Access file from within Outlook.
 
Am Wed, 9 Aug 2006 12:41:53 -0700 schrieb DevDaniel:

Sample with ADO:

Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset

Set cn = New ADODB.Connection
With cn
.Provider = "Microsoft.Jet.OLEDB.4.0"
.ConnectionString = "D:\database.mdb"
.CursorLocation = adUseClient
.Mode = adModeShareDenyNone
.Open
End With

Set rs = New ADODB.Recordset
With rs
.CursorLocation = adUseClient
.CursorType = adOpenStatic
.LockType = adLockOptimistic
Set .ActiveConnection = cn
.Open ("select * from [Tabellenname]")
End With

' close record and connection
rs.Close
cn.Close
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top