Results 1 to 16 of 16

Thread: DAO and MS Access

Hybrid View

  1. #1

    Thread Starter
    Hyperactive Member oyad's Avatar
    Join Date
    Feb 2003
    Location
    PhoxWare MicroSystems
    Posts
    463

    DAO and MS Access

    am using DAO in my VB project with means my Access has to be in MS Access 97. its working fine but i want to passwordthe mdb file. i dont know how to open the file in VB, icant set the password property or whats wrong
    dayo
    Nobody is smarter than all of us!

  2. #2
    PowerPoster BruceG's Avatar
    Join Date
    May 2000
    Location
    New Jersey (USA)
    Posts
    2,657

    Re: DAO and MS Access

    VB Code:
    1. Set objDB = OpenDatabase("C:\SomePath\SomeName.mdb", _
    2.                               True, False, ";pwd=yourpassword")
    "It's cold gin time again ..."

    Check out my website here.

  3. #3
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: DAO and MS Access

    You need to set the password in Access first. Then you need to create a DAO workspace to connect and pass a password.
    VB Code:
    1. Private wsDB As Workspace
    2. Private dbDB As Database
    3. Set wsDB = DBEngine.CreateWorkspace("Username", "admin", "pwd")
    4. Set dbDB = wsDB.OpenDatabase("DBName")
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  4. #4
    Lively Member haruki's Avatar
    Join Date
    Mar 2005
    Location
    Shibuya / Japan
    Posts
    118

    Re: DAO and MS Access

    Weird, Im using Access 2003 with DAO. I dont think its limited to the old 97 version.

  5. #5
    PowerPoster BruceG's Avatar
    Join Date
    May 2000
    Location
    New Jersey (USA)
    Posts
    2,657

    Re: DAO and MS Access

    Correct, DAO still lives on.
    "It's cold gin time again ..."

    Check out my website here.

  6. #6

    Thread Starter
    Hyperactive Member oyad's Avatar
    Join Date
    Feb 2003
    Location
    PhoxWare MicroSystems
    Posts
    463

    Re: DAO and MS Access

    Quote Originally Posted by haruki
    Weird, Im using Access 2003 with DAO. I dont think its limited to the old 97 version.
    whenever i set the database name in the property window, when i get to the recordsource property,i receive an error, so i tried converting the mdb to 97, using tools menu in access and henceforth it worked fine. so i guessed it was the version. or what do u think?
    Nobody is smarter than all of us!

  7. #7
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: DAO and MS Access

    I thought that in order to make changes to a 97 db you needed to convert it to 2000. Then it doesnt matter
    which version of Access your running.

    Are you using the Data control to try to connect?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  8. #8
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: DAO and MS Access

    Quote Originally Posted by RobDog888
    I thought that in order to make changes to a 97 db you needed to convert it to 2000. Then it doesnt matter
    which version of Access your running.

    Are you using the Data control to try to connect?
    If you have the lastest version of MDAC installed (2.7 I believe), you can use DAO with Access 2000 (I know...I accidentally converted my 97 Access copy of Biblio to Access 2000 against which I was running some DAO code on other problem on the forum, and got myself all bollaxed up because my version of MDAC wasn't up to date.)

  9. #9
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: DAO and MS Access

    Actually the latest MDAC is 2.8. Its included in Windows XP SP2, so if the thread starter is running that then
    that could be an issue?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

Posting Permissions

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



Click Here to Expand Forum to Full Width