Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

size of backend DB

1 view
Skip to first unread message

balu

unread,
Sep 9, 2008, 9:43:02 AM9/9/08
to
dear friends
how to have a constant / optional look over the size of back end (splitted)
database from front end ,so that i can automate deleting of some data or
manual deleting.
kindly advise

Arvin Meyer [MVP]

unread,
Sep 12, 2008, 9:34:22 AM9/12/08
to
"balu" <ba...@discussions.microsoft.com> wrote in message
news:EA5B3A1F-5BD5-4064...@microsoft.com...

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


balu

unread,
Sep 17, 2008, 2:54:01 AM9/17/08
to

dear sir ,
since experiencing trouble in accessing the group through my mail , and even
my normal appearence of form also changed i asking advise in this way kindly
excuse.
in a continues form basing on a query , say for eg :- studentid ,
studentname , classid.
i want to open a report by clicking on studentid field , basing on
studentid of the field. but how to code this for each studentid field_click.

and also kindly advise me why i could not able to login to the forum through
my mail which was normal so many days.

Arvin Meyer [MVP]

unread,
Sep 18, 2008, 4:00:23 PM9/18/08
to
1. The relevant like of code should be something like (untested):

DoCmd.OpenReport "YourReportName",,, "StudentID =" & Me.StudentID

2. I have no idea why your email doesn't work, try calling your ISP.

"balu" <ba...@discussions.microsoft.com> wrote in message
news:081CC308-7B4B-49FB...@microsoft.com...

0 new messages