[AccessD] FYI: Good news - VBA in Office 12 and beyond...

Gustav Brock Gustav at cactus.dk
Tue Feb 21 08:00:58 CST 2006


Hi Martin

Oh, news! LoadFromFile was ADO only. So - as Shamil asks - how comes?

/gustav

>>> mwp.reid at qub.ac.uk 21-02-2006 14:29 >>>
Gustav

Here is a bit of DAO which loads a value into a new Access datatype
called Attachment which allows you to save several attachments.

Dim rsEmployees As DAO.Recordset
Dim rsPictures As DAO.Recordset
Set db = CurrentDb

' Get the parent recordset
Set rsEmployees = db.OpenRecordset("Table1")

'Put the parent record into edit mode
rsEmployees.Edit


'Get the attachment recordset
Set rsPictures = rsEmployees.Fields("AttachmentCell").Value

'Set first attachment to loaded picture
rsPictures.Edit
rsPictures.Fields("FileData").LoadFromFile ("C:\test.jpg")
rsPictures.Update

' Update the parent record
rsEmployees.Update



Martin


-----Original Message-----
From: accessd-bounces at databaseadvisors.com 
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock
Sent: 21 February 2006 09:55
To: accessd at databaseadvisors.com 
Subject: Re: [AccessD] FYI: Good news - VBA in Office 12 and beyond...

Hi Martin

Could you elaborate on this please? A recordset of a recordset in DAO?

> .. multi value datatypes. In DAO they act as a child recordset of the 
> parent recordset and have all the properties of a normal recordset.
> So you need to open 2 recordsets when dealing with them

/gustav

>>> mwp.reid at qub.ac.uk 21-02-2006 00:00 >>>
I say a recent demo which combined a .net windows form using a web
service embedded inside access 12 and passing data to Access. I asked
the MS guy for this but he had deleted the example following the
presentation.
VBA is there alive and well just looking at the multi value datatypes.
In DAO they act as a child recordset of the parent recordset and have
all the properties of a normal recordset. So you need to open 2
recordsets when dealing with them

Martin




More information about the AccessD mailing list