Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. [beginner] opening a base throught vba

[beginner] opening a base throught vba

Scheduled Pinned Locked Moved Visual Basic
questiondatabaselearning
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    torNAdE
    wrote on last edited by
    #1

    hi all, i'm using vba under access. i wanna a database secured by a password from another database i used this function in the autoexec macro code: Function Ouvre() Dim ds As DAO.Database Set ds = DBEngine.OpenDatabase("C:\Step3.mdb", False, False, "pwd =alpha") End Function the prob that when i try to open the base it sounds that i couldn't do it. so someone know? how can i wrote a code to connect to the base with password? thx:confused:

    S 1 Reply Last reply
    0
    • T torNAdE

      hi all, i'm using vba under access. i wanna a database secured by a password from another database i used this function in the autoexec macro code: Function Ouvre() Dim ds As DAO.Database Set ds = DBEngine.OpenDatabase("C:\Step3.mdb", False, False, "pwd =alpha") End Function the prob that when i try to open the base it sounds that i couldn't do it. so someone know? how can i wrote a code to connect to the base with password? thx:confused:

      S Offline
      S Offline
      Stephen McGuire
      wrote on last edited by
      #2

      You cannot have two separate databases open in the same instance of Access. You can have linked tables from another DB or you can use the 'Shell' command to open the DB in another instance of Access: Private Sub CommandButton_Click() 'Open another database Dim PathNameOfDB As string PathNameOfDB="C:\Pathname\BDName.mdb" Shell "C:\Program Files\Microsoft Office\Office11\msaccess.exe " & "PathNameOfDB", vbMaximizedFocus Application.Quit ' closes current application so new DB is current. End Sub MDBMakers.com is a great source for Access and VBA solutions. Steve -- modified at 8:46 Friday 4th August, 2006

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups