Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Nov 2001
    Posts
    192
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Inivisble Database (Access 2000)

    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

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Inivisble Database (Access 2000)

    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
    Francois

  3. #3
    Star Lounger
    Join Date
    Dec 2001
    Location
    Birmingham, Alabama USA
    Posts
    95
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Inivisble Database (Access 2000)

    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

    <font color=448800>' 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</font color=448800>

    Public Function SetAttributes(ByVal FullFilePath As String, Optional ByVal FileAttributes As Long = &H2) As Long
    <font color=448800>' Makes sure that the file path is not too long</font color=448800>
    Ricky Hicks
    Microsoft MVP
    Birmingham, Alabama USA

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •