I finally made the connection of matlab and ms access. Here's the tutorial on how to configure the connection first.
After successfully making a connection, I used this code on a callback.
conn = database('databasename','username','password');
dbpath = 'C:\Users\______.mdb'; %insert database path
tableName = 'datetime'; %insert tablename here in MSAccess
colname = {'column1'} %column of your tables in MsAccess
date = datestr(now); %the string of date and time
coldata = {date}
insert(conn,tableName,colname,coldata); %will insert the data to the database.
close(conn);