Results 1 to 5 of 5
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Posts
    254
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Invisible database (Access 2000)

    I was told that i could make the database invisible with Shell Attrib
    but neither 'Shell "Attrib " & ANewDB & " +h"
    nor
    Shell "Attrib +h"
    give any results.
    What can i add on my code?


    Private Sub Command2_Click()
    Call ANewDB("c:BENewDB.mdb")
    'Shell "Attrib " & ANewDB & " +h"
    Shell "Attrib +h"
    End Sub
    Function ANewDB(tName As String)
    Dim wsp As Workspace, db As Database
    Dim db2 As Database
    Set db = CurrentDb
    Set wsp = DBEngine.Workspaces(0)
    Set db2 = wsp.CreateDatabase(tName, dbLangGeneral)
    db2.Close
    End Function

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

    Re: Invisible database (Access 2000)

    Shell "Attrib " & ANewDB & " +h"
    should work if the function ANewDB return the path and the file name.
    Francois

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Posts
    254
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Invisible database (Access 2000)

    Thank you for your reply.I receive the error "argument not optional pointing to ANewDB
    But i have alsready shown the path name : the new database should be in the folder BE and have the name NewDB :
    Call ANewDB("c:BENewDB.mdb")
    Shell "Attrib " & ANewDB & " +h"

    Why do i get the error ?

    regards

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

    Re: Invisible database (Access 2000)

    Sorry, I hadn't seen that you post the function also.
    The function ANewDB did not return the name of the db, but create and close it.
    You could use :

    Private Sub Command2_Click()
    Shell "Attrib " & ANewDB("c:BENewDB.mdb") & " +h"
    End Sub

    Function ANewDB(tName As String)
    Dim wsp As Workspace, db As Database
    Dim db2 As Database
    Set db = CurrentDb
    Set wsp = DBEngine.Workspaces(0)
    Set db2 = wsp.CreateDatabase(tName, dbLangGeneral)
    ANewDB = db2.Name
    db2.Close
    End Function
    Francois

  5. #5
    3 Star Lounger
    Join Date
    Jan 2001
    Posts
    254
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Invisible database (Access 2000)

    Thank you very much indeed

Posting Permissions

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