Open Access DB from Outlook

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

Guest

Please help. I need to open an Access 2000 database (which is on a network
server) from inside Outlook 2000, using a macro assigned to a toolbar button.

If it can be done.

Thank you for your help.
 
Please help. I need to open an Access 2000 database (which is on a
network
server) from inside Outlook 2000, using a macro assigned to a toolbar
button.

If it can be done.

Yes, you have to learn how to use ADO to open a connection to the database
and then open a table or execute a query within the table. This the returns
a recordset which you can walk through processing each row as required.

Cheers, Rob.
 
Am Mon, 9 Jan 2006 08:07:04 -0800 schrieb Richard:

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:\db.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 [Field list] from [Tabellenname]")
End With

Finished:
rs.Close
cn.Close
 
Back
Top