• Inivisble Database (Access 2000)

    Author
    Topic
    #364181

    How to code a database to be invisible?

    i have a copy command as:
    Public Function copydb()
    Dim strSource As String
    Dim strDest As String
    strSource = “C:BEdb1.mdb”
    strDest = “C:BEdb2.mdb”
    FileCopy strSource, strDest
    End Function
    Can i give a command in the code to make the copied database invisible?
    Something like STrDest.Visible = Fale, alhough it doesnt work

    Viewing 0 reply threads
    Author
    Replies
    • #558270

      You can use

      Shell “Attrib ” & strDesr & ” +h”

      when the file is copied.
      You maybe have to add some delay so that Dos can end his copying before Access send the attrib command

      • #558296

        If Francois’ reply does not do the trick ……. the file attributes of a file can be altered using a Windows API function:

        Declare Function SetFileAttributes Lib “kernel32.dll” Alias _
        “SetFileAttributesA” (ByVal lpFileName As String, _
        ByVal dwFileAttributes As Long) As Long

        ‘ Use these constants to set the attributes you want
        ‘ FILE_ATTRIBUTE_ARCHIVE = &H20
        ‘ FILE_ATTRIBUTE_COMPRESSED = &H800
        ‘ FILE_ATTRIBUTE_DIRECTORY = &H10
        ‘ FILE_ATTRIBUTE_HIDDEN = &H2
        ‘ FILE_ATTRIBUTE_NORMAL = &H80
        ‘ FILE_ATTRIBUTE_READONLY = &H1
        ‘ FILE_ATTRIBUTE_SYSTEM = &H4

        Public Function SetAttributes(ByVal FullFilePath As String, Optional ByVal FileAttributes As Long = &H2) As Long
        ‘ Makes sure that the file path is not too long

    Viewing 0 reply threads
    Reply To: Inivisble Database (Access 2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: