Amiin sama2 mas Tio, terimakasih atas do'anya

Salam


Nurhasim

--- On Thu, 1/21/10, [email protected] <[email protected]> wrote:

From: [email protected] <[email protected]>
Subject: Re: [belajar-access] Back Up Database
To: [email protected]
Cc: [email protected]
Date: Thursday, January 21, 2010, 11:29 PM







 



  


    
      
      
      

Terima kasih Mas Hasimnurhsm dan Mas Aksan, semoga Tuhan membalas kebaikan Mas 
berdua dan rekan milis lain. Dikasih duit banyak dan di beri kesehatan seperti 
harapan Mas Aksan. Amiin..





Salam,

Tio












"hasimnurhsm@ yahoo.com" <hasimnurhsm

Sent by: belajar-access@ yahoogroups. com
01/22/2010 01:55 PM

Please respond to belajar-access


        

        To:        belajar-access@ yahoogroups. com

        cc:        

        Subject:        Re: [belajar-access] Back Up Database





  



mungkin contoh spt ini yang mas tio butuhkan, kebetulan sy ada simpan. soalnya 
sudah lama dpt jadi lupa darimana asalnya.





Salam





Nurhasim



--- On Thu, 1/21/10, Aksan Kurdin <aksan.kurdin@ gmail.com> wrote:



From: Aksan Kurdin <aksan.kurdin@ gmail.com>

Subject: Re: [belajar-access] Back Up Database

To: belajar-access@ yahoogroups. com

Date: Thursday, January 21, 2010, 10:20 PM



  
tio adjie,

weekend begini lagi males buat utak-atik kode ini :)

pada intinya sih, kode ini menjalankan perintah :



buat database baru

CreateDatabase strFileName, dbLangGeneral 



lalu copy semua obyek tabel yang masuk dalam daftar, dalam hal ini array 
variable, ke database baru tersebut:

    For i = 0 To intLastTableToBacku p 

        strTblName = strTablesToBackup( i) 

        DoCmd.CopyObject strFileName, strTblName, acTable, strTblName 

    Next i 



ayo, yang nangkap maksud dari kode ini bisa berkarya dikit dong untuk nolongin 
mas tio adjie dengan problemnya, bikinin aplikasi kecil2an untuk salin tabel ke 
backup file mdb baru.

ayo ..... ayo ....





aksan kurdin









tio.ad...@ptssb. co.id wrote: 
  


Mas Aksan dan rekan milis Access lainnya. Ma'af baru reply : 



Ini complete functionnya : 



Bisakah secara detail bagaimana memanggilnya dari suatu form ? 



Terima kasih sebelumnya. 

Salam, 

Tio 



Option Compare Database 

Private Const strDefaultBackupFil e = "MasterDatabase. mdb" 

Private Const strBackupExtension = ".mdb" 



Private Const strTmpTable = "tblTempRestore" 



Private strTablesToBackup( 0 To 16) As String ' initialized below 

Private strFirstVersion( 0 To 16) As String ' initialized below 

Private Const intLastTableToBacku p = 16 ' includes version table 

Private Const intLastTableToResto re = 15 ' does not include version table -- 

   ' we back it up but don't restore it, the version goes with the 

   ' software 

Private Const intVersionTableInde x = 16 

Public Function DoBackUp() 

    ' Prompts user for backup location, and backs up database tables 

    ' This is a function so that it can be run directly from a menu 

    

    Dim strFileName As String 

    Dim strTblName As Variant 

    Dim i As Integer 

      

    On Error GoTo endsub 

    

    Initialize 

        

    ' Ask user to choose file name 

        

    strFileName = GetFileName( strDefaultBackup File, _ 

        "DatabaseSekolah (*" & strBackupExtension & ")" & vbNullChar & _ 

        "*" & strBackupExtension & vbNullChar, _ 

        "Back up database to...", 1, 47) 

        

    If (strFileName = "") Then 

        ' user cancelled 

        Exit Function 

    End If 

    

    ' create new MDB database file 

    

    DoCmd.Hourglass True 

    

    CreateDatabase strFileName, dbLangGeneral 

    

    Form_FRMBackup. Refresh 

    

    ' save all tables to backup database, except system objects 

    For i = 0 To intLastTableToBacku p 

        strTblName = strTablesToBackup( i) 

        DoCmd.CopyObject strFileName, strTblName, acTable, strTblName 

    Next i 

    

    DoCmd.Hourglass False 

    

    MsgBox "Backup Database Berhasil", , "Backup Database" 

    Exit Function 

    

endsub: 

   DoCmd.Hourglass False 



   DisplayError "backup", Err.Description 

End Function












Aksan Kurdin <aksan.kurdin@ gmail.com> 

Sent by: belajar-access@ yahoogroups. com 
01/20/2010 05:24 PM 

Please respond to belajar-access 
        

        To:        belajar-access@ yahoogroups. com 

        cc:         

        Subject:        Re: [belajar-access] Back Up Database







  
Procedure berikut yang digunakan dalam fungsi dobackup adalah user defined, dan 
tidak ditemukan, coba copy paste isi dari function:



Initialize

GetFileName



Juga beberapa variabel tampaknya di deklarasikan public atau berada di bagian 
deklarasi dalam modul yang sama, seperti strDefaultBackupFil e, 
strBackupExtension, intLastTableToBacku p,strTablesToBac kup(i)



tio.ad...@ptssb. co.id wrote:



Agar bisa dites bersama, tolong sertakan fungsi lengkapnya.





aksan kurdin







  


Dear Pakar Access, 



Saya dapat kode ini dari internet, tapi kenapa ya tidak bisa saya panggil dari 
suatu form. Form ini saya namakan FRMBackup. Maksud saya adalah saya ingin 
memback up Database dari suatu form. 



Terima kasih sebelumnya. 

Tio 





Public Function DoBackUp() 

    ' Prompts user for backup location, and backs up database tables 

    ' This is a function so that it can be run directly from a menu 

    

    Dim strFileName As String 

    Dim strTblName As Variant 

    Dim i As Integer 

      

    On Error GoTo endsub 

    

    Initialize 

        

    ' Ask user to choose file name 

        

    strFileName = GetFileName( strDefaultBackup File, _ 

        "DatabaseSekolah (*" & strBackupExtension & ")" & vbNullChar & _ 

        "*" & strBackupExtension & vbNullChar, _ 

        "Back up database to...", 1, 47) 

        

    If (strFileName = "") Then 

        ' user cancelled 

        Exit Function 

    End If 

    

    ' create new MDB database file 

    

    DoCmd.Hourglass True 

    

    CreateDatabase strFileName, dbLangGeneral 

    

    Form_FRMBackup. Refresh 

    

    ' save all tables to backup database, except system objects 

    For i = 0 To intLastTableToBacku p 

        strTblName = strTablesToBackup( i) 

        DoCmd.CopyObject strFileName, strTblName, acTable, strTblName 

    Next i 

    

    DoCmd.Hourglass False 

    

    MsgBox "Backup Database Berhasil", , "Backup Database" 

    Exit Function 

    

endsub: 

   DoCmd.Hourglass False 



   DisplayError "backup", Err.Description 

End Function 




============ ========= ========= ========= ========= ========= ========= 
========= 

This email is confidential.  If  you are not the  addressee tell the sender 

immediately  and destroy this  email without using,  sending or storing it. 

Emails are not secure  and may suffer  errors, viruses, delay, interception 

and amendment.  The Trakindo Group of Companies do not accept liability for 

damage   caused   by   this   email   and   may   monitor   email  traffic. 

Unless expressly stated, any opinions are the sender's and are not approved 

by  the  Tiara Marga Trakindo  Group of Companies and  this email is not an 

offer, solicitation,  recommendation   or   agreement   of    any     kind. 

============ ========= ========= ========= ========= ========= ========= 
=========

       







============ ========= ========= ========= ========= ========= ========= 
========= 

This email is confidential.  If  you are not the  addressee tell the sender 

immediately  and destroy this  email without using,  sending or storing it. 

Emails are not secure  and may suffer  errors, viruses, delay, interception 

and amendment.  The Trakindo Group of Companies do not accept liability for 

damage   caused   by   this   email   and   may   monitor   email  traffic. 

Unless expressly stated, any opinions are the sender's and are not approved 

by  the  Tiara Marga Trakindo  Group of Companies and  this email is not an 

offer, solicitation,  recommendation   or   agreement   of    any     kind. 

============ ========= ========= ========= ========= ========= ========= 
=========

        








============ ========= ========= ========= ========= ========= ========= 
========= 
This email is confidential.  If  you are not the  addressee tell the sender 
immediately  and destroy this  email without using,  sending or storing it. 
Emails are not secure  and may suffer  errors, viruses, delay, interception 
and amendment.  The Trakindo Group of Companies do not accept liability for 
damage   caused   by   this   email   and   may   monitor   email  traffic. 
Unless expressly stated, any opinions are the sender's and are not approved 
by  the  Tiara Marga Trakindo  Group of Companies and  this email is not an 
offer, solicitation,  recommendation   or   agreement   of    any     kind. 
============ ========= ========= ========= ========= ========= ========= 
=========


    
     

    
    


 



  






      

Kirim email ke