|
-
May 9th, 2001, 07:11 AM
#1
Thread Starter
Addicted Member
Using the CreateFile and GetFileTime API's
I've always used the CreateFile API to get a file handle, which I can then pass into the GetFileTime API to get the file times. This works fine until I tried to get a file handle to a Microsoft Access Database file which was open in Access.
Is there another way of getting a file handle that won't fail if the file is locked?
Last edited by VB6Coder; May 9th, 2001 at 07:15 AM.
-
May 9th, 2001, 10:15 AM
#2
Go to VBNET
Search for "file api"
Take a look at this code:
Obtaining and Changing a File's Created, Accessed and Modified Dates
This uses a different suite of api's.
-
May 10th, 2001, 07:05 AM
#3
Thread Starter
Addicted Member
The VBNet example uses the OpenFile API, so I'll give that ago.
Cheers
-
May 10th, 2001, 07:53 PM
#4
Registered User
I think it depends on how the access database was opened. If opened for exclusive use, I don't think you will be able to get a handle.
In all other situations you should be able to get a handle using create file api.
-
May 11th, 2001, 02:34 AM
#5
Thread Starter
Addicted Member
I wasn't opening the Access database exclusive, and for some reason the CreateFile API kept returning me 0.
I've now changed my code to use the OpenFile API instead of the CreateFile API and that has fixed the problem.
Cheers Guys
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|