danboh
danboh

Reputation: 778

MS Access CurrentDb.execute not working

I'm currently running a vbscript in MS Access 2010 that retrieves some attachments from MS Outlook and inserts that data into a table in the MS Access database. The issue I have is that I'm trying to update these records after they were inserted (using TransferText) by using CurrentDb.Execute, unfortunately this piece of code doesn't seem to work (no errors thrown, no warnings, nothing):

Set Db = CurrentDb
DoCmd.SetWarnings True
With Db
  .Execute "UPDATE HOURLY_ENTITY_STATS SET TIMESTAMP = 'statDate'"
Debug.Print .RecordsAffected & " were updated"

So everytime I execute this query, a new value should be added to the column TIMESTAMP (text type) but so far nothing happens.

I did my own research before posting the question here and couldn't find anyone having a similar issue.

If you can think of anything, please let me know!

Upvotes: 2

Views: 2679

Answers (1)

danboh
danboh

Reputation: 778

I don't why I hadn't seen this before but thanks to HansUp I got it to work. The problem is that I was using a reserve word in the SQL query, so had to encapsulate the column name in brackets [TIMESTAMP]

Thank you all.

Upvotes: 2

Related Questions