Access Query Result from Another Program

J

Jake

I'm trying to access a query result from Outlook, and have
the following (the recordsets are used later):

Set dbe = objItem.Application.CreateObject
("DAO.DBEngine.36")
Set wks = dbe.Workspaces(0)
Set dbs = wks.OpenDatabase(strDBPath)
Set rs = dbs.OpenRecordset(strEmailTable)
Set rs2 = dbs.OpenRecordset(strAttachmentTable)

If dtReceivedTime = #12:00:00 AM# Then dtReceivedTime
= DLookup("MaxOfEmailReceived", "qryImportDT")

If I manually open the database (and leave it open) before
running the code, my If statement works fine. Otherwise,
I receive error 2950 (Reserved Error). Any ideas on how
to get this to work?

Thanks!
Jake
 
J

Jake

Nevermind...I just created another recordset and can pull
the value from that.

Jake
 

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

Top