Accessing an Access DB from Outlook via VBA

50 pts.
Tags:
Access
Outlook 2003
SQL
VBA
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

Software/Hardware used:
outlook 2003, access 2003, vba ,sql
ASKED: December 15, 2009  2:23 PM
UPDATED: December 22, 2009  10:28 AM

Answer Wiki

Thanks. We'll let you know when a new response is added.

I am not sure if I am following your question. The Time you are referring is it the Time that Outlook puts on the message header? Or is the time included in the message as you read the Outlook message?
SbElectric

Discuss This Question: 5  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Camastanta
    Hi It is the time in the message-body I use, not the time from Outlook. This is the message-body: 10125,Road runner,16/12/2009 18:28:00,(16/12/2009 17:28:00 UTC),11,51.32400000,3.20000000, Position report. (fields: database-id, name, date local time, date utc,status, position, other) The database: the field dateLT has format date/time with standard date-notation. I compare the date from the message-body with the dateLT-field in the database. When there exists a record for that vehicle the record will be replaced and otherwise the content of the body is added to the database. In fact I use more fields to compare than just the date but it is with the date I have troubles. Regards camastanta
    50 pointsBadges:
    report
  • Camastanta
    correction: when a message already exists in the db, the message will be discarted
    50 pointsBadges:
    report
  • Camastanta
    Hi I am going to rephrase this in another question. Regards Camastanta
    50 pointsBadges:
    report
  • JennyMack
    Hi Camastanta, If you wouldn't mind, we'd rather that you keep the conversation in this question -- that way users can follow your logic. If you carry your problem into a new question, some users may be missing some valuable information. Good luck getting your answer! Jenny Community Manager
    4,280 pointsBadges:
    report
  • Camastanta
    ok
    50 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following