Accessing an Access DB from Outlook via VBA

Posted by camastanta on Stack Overflow See other posts from Stack Overflow or by camastanta
Published on 2009-12-16T09:47:42Z Indexed on 2010/05/03 7:38 UTC
Read the original article Hit count: 181

Filed under:
|
|
|

Hi

The situation:

In Outlook I get a message from a server. The content of the message needs to be put into an Access db. But, there may not exist another message with the same date. So, I need to look into a db if there is already a message with the same date and time. If there exists one, then it needs to be replaced and otherwise the message needs to be added to the database. The database contains a list of current positions from the vehicles on the road.

The problem:

I have problems to compare a date time with a date time in an Access DB via VBA. The query I use returns no records but there is a record in the database.

This is the query I use:

  adoRS.Open "SELECT * FROM currentpositions WHERE ((currentpositions.  
  [dateLT])=" & "#" & date_from_message & "#" & ")", adoConn, adOpenStatic, adLockOptimistic

Second I need to now what the result is of that query.

How can I determine the number of records that my query gives me?

Thanks camastanta

© Stack Overflow or respective owner

Related posts about outlook-2003

Related posts about ms-access