|
-
Mar 2nd, 2004, 04:49 PM
#1
Thread Starter
Member
coping file to a:
Hi, I need to make db backup From my vbproject when db is running.
a) it's necessary to close db before, and how is better to do that?
b) drive a need to have free space, how I know free disk space?
c) How can I compact database from vbcode?
then, it's enough to make a copy?
VB Code:
[COLOR=blue]FileCopy[/COLOR] C:\DataBase1,A:\DataBase1
And, the last question...how I know when the copy is end, for open db again
Thank, sorry by my english
-
Mar 2nd, 2004, 05:02 PM
#2
Banned
You'll have to close the database before copying yes.
Just close the recordsets and the database.
VB Code:
RecordSet.Close
Set RecordSet = Nothing
Database.Close
Set Database = Nothing
To get the amount of free space:
VB Code:
Private Declare Function GetDiskFreeSpace Lib "kernel32" Alias "GetDiskFreeSpaceA" (ByVal lpRootPathName As String, lpSectorsPerCluster As Long, lpBytesPerSector As Long, lpNumberOfFreeClusters As Long, lpTtoalNumberOfClusters As Long) As Long
Private Sub Form_Load()
'KPD-Team 1998
'URL: [url]http://www.allapi.net/[/url]
Dim Sectors as Long,Bytes as Long,FreeC as Long, TotalC as Long,Total as Long,Freeb as Long
'Retrieve information about the C:\
GetDiskFreeSpace "a:\", Sectors, Bytes, Freec, Totalc
MsgBox "Free bytes:" + Str$(Freeb)
What exactly do you mean with "compact" your database?
Do you mean you want to compress it?
That's pretty hard, in VB, I think..
-
Mar 2nd, 2004, 05:06 PM
#3
Thread Starter
Member
It's ok, but how I know when the copy is end, for open db again
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
|