Rabu, 28 Mei 2014

Re: [MS_AccessPros] Re: List of Attachements

 

You could try running this code and see if you get any data for the timestamp.

Public Sub TestAttach()
  Dim rs As DAO.Recordset
  Dim rsA As DAO.Recordset
  Dim fld As DAO.Field
  'edit to your domain name
  'and name of your attachment field
  Const DomainName = "Products"
  Const AttachmentField = "Attachments"
  On Error Resume Next
  Set rs = CurrentDb.OpenRecordset(DomainName)
  
  Do While Not rs.EOF
  Set rsA = GetAttachments(rs, AttachmentField)
  Do While Not rsA.EOF
    Debug.Print rsA.Fields("FileName").Name & " " & rsA!fileName
    Debug.Print rsA.Fields("FileTimeStamp").Name & " " & Nz(rsA!fileTimeStamp.Value, "No Data")
    Debug.Print
  rsA.MoveNext
  Loop
  rs.MoveNext
  Loop
End Sub
Public Function GetAttachments(rs As DAO.Recordset, AttachmentField As String) As Recordset
  Set GetAttachments = rs.Fields(AttachmentField).Value
End Function

As I said, when I do it, the timestamp is empty.  However, I cannot find any information for when this is actually populated or if it is.  I get results like this in the immediate window.

FileName rptCrossReference.rtf
FileTimeStamp No Data

FileName testMonth.pdf
FileTimeStamp No Data

FileName cnicp_a135455.pdf
FileTimeStamp No Data

I also tried to populate the timestamp by code and I get a field is not updateable message.  So if you really need this, you may have to roll your own solution  I cannot find anything on line with more details about this.


On Wed, May 28, 2014 at 9:56 AM, ka0t1c_ang3l <no_reply@yahoogroups.com> wrote:
 

I typed in the SQL as you said, but it did not return any data.  When I went back to check the SQL I noticed that the code was changed to include the following:

 

[CONTRACT].[FileTimeStamp] AS Expr1

 

Your help is greatly appreciated! :)


__._,_.___

Posted by: Peter Poppe <plpoppe@gmail.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (7)

.

__,_._,___

Tidak ada komentar:

Posting Komentar