Here's an API to get the size of a file. I believe this code was written by
Dev Ashish. I haven't tested it myself:
Private Declare Function apiGetFileSize Lib "kernel32" _
Alias "GetFileSize" _
(ByVal hFile As Long, _
lpFileSizeHigh As Long) _
As Long
Private Declare Function apiCloseHandle Lib "kernel32" _
Alias "CloseHandle" _
(ByVal hObject As Long) _
As Long
Private Declare Function apiCreateFile Lib "kernel32" _
Alias "CreateFileA" _
(ByVal lpFileName As String, _
ByVal dwDesiredAccess As Long, _
ByVal dwShareMode As Long, _
ByVal lpSecurityAttributes As Long, _
ByVal dwCreationDisposition As Long, _
ByVal dwFlagsAndAttributes As Long, _
ByVal hTemplateFile As Long) _
As Long
Private Const GENERIC_READ = &H80000000
Private Const GENERIC_WRITE = &H40000000
Private Const OPEN_EXISTING = 3
Private Const cERR_FILESIZE = &HFFFFFFFF
Function fGetFileSize(strFile As String) As String
Dim lngRet As Long, hFile As Long, lngSize As Long
If Len(Dir(strFile)) > 0 Then
hFile = apiCreateFile(strFile, GENERIC_READ Or GENERIC_WRITE, _
0&, 0&, OPEN_EXISTING, 0&, 0&)
lngRet = apiGetFileSize(hFile, lngSize)
If lngRet <> cERR_FILESIZE Then
fGetFileSize = lngRet & " bytes"
End If
End If
lngRet = apiCloseHandle(hFile)
End Function
Before you start deleting records to control file size, you should be
compacting your database backend.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com
and also kindly advise me why i could not able to login to the forum through
my mail which was normal so many days.
DoCmd.OpenReport "YourReportName",,, "StudentID =" & Me.StudentID
2. I have no idea why your email doesn't work, try calling your ISP.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com
"balu" <ba...@discussions.microsoft.com> wrote in message
news:081CC308-7B4B-49FB...@microsoft.com...