Saving separate tables

Hi,

How can i let the user backup (save) 1 or more tables in an Access database thru the application?

Thanks,

VBnewbie

Comments

  • : Hi,
    :
    : How can i let the user backup (save) 1 or more tables in an Access database thru the application?
    :
    : Thanks,
    :
    : VBnewbie
    :
    :
    You can back-up access database and all its table using this.

    In a Backup CommandButton, Paste this

    Dim l As Long, l2 As Long
    Dim f1 As String 'For
    Dim f2 As String
    Dim txt As Long
    Dim x As Integer
    Text1.Text = ""
    f1 = "D:Tris.txt" 'Place the path and filename of you database here
    You can place a textbox for them to name the Backup Filename
    f2 = "D: ris.bak" 'The name of the Backup File
    Open f1 For Binary As 1
    Open f2 For Binary As 2
    l2 = LOF(1) 'getting the lenght of file
    l = 1 'Place in the beginning of file
    While l <= l2
    Get 1, l, txt
    Put 2, l, txt
    l = l + 1
    Wend
    You can also add a progress bar for them to see the current progress of the backing up, cause backing a large file might let them think that it already hang. if you don't know how just post it here again.
  • : : Hi,
    : :
    : : How can i let the user backup (save) 1 or more tables in an Access database thru the application?
    : :
    : : Thanks,
    : :
    : : VBnewbie
    : :
    : :
    : You can back-up access database and all its table using this.
    :
    : In a Backup CommandButton, Paste this
    :
    : Dim l As Long, l2 As Long
    : Dim f1 As String 'For
    : Dim f2 As String
    : Dim txt As Long
    : Dim x As Integer
    : Text1.Text = ""
    : f1 = "D:Tris.txt" 'Place the path and filename of you database here
    : You can place a textbox for them to name the Backup Filename
    : f2 = "D: ris.bak" 'The name of the Backup File
    : Open f1 For Binary As 1
    : Open f2 For Binary As 2
    : l2 = LOF(1) 'getting the lenght of file
    : l = 1 'Place in the beginning of file
    : While l <= l2
    : Get 1, l, txt
    : Put 2, l, txt
    : l = l + 1
    : Wend
    : You can also add a progress bar for them to see the current progress of the backing up, cause backing a large file might let them think that it already hang. if you don't know how just post it here again.
    :

    *sigh*

    VBNewbie, check out any Tutorial/MSDN or whatever else for the SQL-Language, especially the "SELECT INTO"-Statement
    ------------------------------------------
    Only stupidity of mankind and the universe
    are infinite, but i'm not sure concerning
    the universe. A. Einstein

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories