If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Access > Auto import of OLE Object

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-16-03, 11:44
eciabattari eciabattari is offline
Registered User
 
Join Date: Apr 2003
Posts: 31
Auto import of OLE Object

Need some help... I'm trying to automate the process of importing files into a temporary table called "tblTemp" with two fields, PurchaseID & ApprovalDocument (ole object). The document title is the same as the purchaseID number. here's what i've got so far.


'------------------------------------------------------------------------------
Function GetMessages(sPath As String)

On Error GoTo ErrorHandler

Dim sFile As String
Dim db As Database, rs As Recordset

sFile = Dir(sPath & "\*.msg")
Set db = CurrentDb
Set rs = db.OpenRecordset("tblTemp", dbOpenDynaset)
On Error Resume Next
Do Until sFile = ""
rs.AddNew
rs!PurchaseID = Left(sFile, Len(sFile) - 4)
rs!ApprovalDocumentFile = sFile
rs.Update
sFile = Dir
Loop
rs.Close
Set rs = Nothing
Set db = Nothing

Exit Function

ErrorHandler:
MsgBox Err.Description

End Function
'--------------------------------------------------------------------------
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On