Want to persist metadata on files through Access vba

PaulSchrum

Registered User.
Local time
Today, 03:56
Joined
Jul 30, 2011
Messages
20
I need some advice.

In Access VBA, I want to create an application to do a kind of file check-out/check-in system. I want the file state (checked in, checked out) to be stored directly on the file in the file system. I do not want to use Lock exclussively because other users may have locked a file, so I want to lock each checked-out file, but return the file to the original Locked state at check-in time. This means I can't just lock it and say locking is the same as checking out.

The files may be of any kind, but especially .xlsx and .dgn.

I thought I had a brilliant idea when I thought up storing data in the file's Comments field. After a lot of research, I found

http://www.vbaexpress.com/kb/getarticle.php?kb_id=405#instr

which explains how to read various Properties from a file. I implemented that, but was really disappointed to find that all I can do is read the contents of Comments. I can't write to it. :mad:

So, now finally, my question:

Can anyone suggest a way to write string data to a file which will allow me to persist my own meta data, something like: "PrevState:NotLocked; CheckoutState:CheckedOut;User:someUserName"
?

I have also thought about creating a hidden file in any directory with a checked-out file. It would be a text file with the filename of the checked out files of that directory plus the other data. This approach is not preferable because the data is not attached to the file. It is not preferable, but it is my fallback in case what I am wanting to do turns out not to be possible.

Suggestions on how to implement check-out at file level?

Also, if anyone knows how to write values to Comments in VBA, that would solve my problem.

Thanks.
 
Yeah, I saw that Dsofile.dll but it works only for Office documents and the OP is needing it for .dgn files too, which I'm not familiar with.

The closest I could get to reading the properties was using WMIC but that couldn't edit it. It seems the properties are application specific so to interface with it you will need a reference to the app object (or something like that)
 
@Guus2005: Thanks a bunch. I will look in to this soon.

.dgn extension is Microstation (www.bentley.com, CAD application used a lot by Civil Engineers), which is also VBA-enabled.

@vbaInet: Your comments are noted, and thank you very much for them. I hope this fact will not hinder me, but it will be part of what I investigate. The Comments field seems to be universal to all FAT or NTFS files, so I am hoping it is not application-specific.

Will post more soon. (But not too soon -- I am getting married in a week so will be away-from-keys intermittently for a while.
 
@vbaInet: Your comments are noted, and thank you very much for them. I hope this fact will not hinder me, but it will be part of what I investigate. The Comments field seems to be universal to all FAT or NTFS files, so I am hoping it is not application-specific.
I just read the articles and it seems DSO can do more than just Office files. So you might be in luck.

Will post more soon. (But not too soon -- I am getting married in a week so will be away-from-keys intermittently for a while.
Have a fun day! :D
 

Users who are viewing this thread

Back
Top Bottom