Is LastUpdated property of TableDef the last update after INSERT only?

keirnus

Registered User.
Local time
Tomorrow, 08:00
Joined
Aug 12, 2008
Messages
99
I noticed that the LastUpdated property of defined table is the last update of INSERT query only.

When I do UPDATE, after that the LastUpdated isn't updated. Same goes to DELETE.

I thought the LastUpdated property "returns the date and time of the most recent change made to an object."

Why is the "recent change" only applies to INSERT? (not in UPDATE or DELETE)

Here's a sample code:
----------------------------------
Dim tdfTemp As TableDef
Dim db As DAO.Database

Set db = CurrentDb

With db

Set tdfTemp = .TableDefs!TableNameHere

End With

tdfTemp.LastUpdated <--- THIS ONE!
----------------------------------

I'm confused.
 
are you sure you're referring to the right table? that doesn't really make a whole lot of sense...

Although maybe the "lastupdated" and "lastmodified" properties are different...??
 
Last edited:
are you sure you're referring to the right table? that doesn't really make a whole lot of sense...

Although maybe the "lastupdated" and "lastmodified" properties are different...??

Yes...I'm referring to the right table.
Same table where I used UPDATE and DELETE Queries
and yet the LastUpdated property wasn't changed.
It only changes when I INSERT data to same table.

Is this a bug? :eek:
Or did I do something wrong? :confused:

Why not try it yourself..?
 
i'm not going to try it myself because I'm the one helping you. ;) I just got done googling for you yesterday! How do you know it changes? What display tool are you using? How are you getting the "modified" property to the point at which you can view it? I'm assuming you cannot display the information simply by writing:
Code:
tdfTemp.LastUpdated
You have to command the property somehow, don't you?
 
i'm not going to try it myself because I'm the one helping you. ;) I just got done googling for you yesterday! How do you know it changes? What display tool are you using? How are you getting the "modified" property to the point at which you can view it? I'm assuming you cannot display the information simply by writing:
Code:
tdfTemp.LastUpdated

You're right. You're the one helping. hehehe. Sorry.

I used labels in UI for display:
------------------------------------START
lblLastUpdate.Caption = GetLastUpdate
------------------------------------END

Made a GetLastUpdate function to return string:
------------------------------------START
Public Function GetLastUpdate() As String

Dim tdfTemp As TableDef
Dim db As DAO.Database

Set db = CurrentDb

With db

Set tdfTemp = .TableDefs!TableNameHere

End With

GetLastUpdate = tdfTemp.LastUpdated

End Function
------------------------------------END

When I DELETE, I use this:
DoCmd.RunSQL sSQLDelete

When I INSERT, I actually m using the CSV Import:
DoCmd.TransferText acImportDelim, "mpms_import_csv_spec", TableName, FileFullPath


Is my way of getting the LastUpdate wrong?
Are my INSERT and DELETE wrong?
 
By the way, TableName and TableNameHere are the same table...
Forgot to make them the same.
 
Info:

It seems like it is OK now.
Dunno what I did. (abunai desu)

Anyway, I added db.Close in GetLastUpdate().

Still figuring out what mistake I did last time.
 
db.close doesn't do anything. set your objects to nothing when finished:
set db = nothing
etc.
 

Users who are viewing this thread

Back
Top Bottom