dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Assign a pwd to a database

  1. #1
    Join Date
    Apr 2000
    Location
    Dorado, P.R.
    Posts
    221

    Assign a pwd to a database

    Hi everybody;

    I need to make a small program that takes a MS Access database and assing a password to it, just like Access does it.

    Any help will be strongely appreciated


    adcomp

  2. #2
    Join Date
    Sep 2001
    Location
    IL, USA
    Posts
    1,090
    Code:
    'Add reference to Microsoft DAO Object Library
    Private Sub Command1_Click()
       Dim db As Database, dbName As String, Pass As String
       'Change dbName and Pass to the whatever you want
       dbName = "c:\new.mdb"
       Pass = "MyPassword"
       Set db = DBEngine.opendatabase(dbName, True, False)
       db.NewPassword "", Pass
       db.Close
       Set db = Nothing
    End Sub

Posting Permissions

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


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)