Results 1 to 16 of 16

Thread: DAO and MS Access

  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

  10. #10
    Member
    Join Date
    Apr 2005
    Posts
    47

    Re: DAO and MS Access

    implementing just a single password potentially is a bad idea. if in the future u r trying to expand the app for multi users u will not be able to create users, so u cant set access permision. look up workgroup info files for further info on this.

    ps
    i am coding a security sys for my app at the minute which uses workgroup file and its prooving to be very hard as i cant find any good tutorials on it and the documentation isnt very good

  11. #11

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

    Re: DAO and MS Access

    plz, when i try to open the app on an OS with no VB installed , i received errors,
    something like this

    runtime error "713"
    class not registered,looking for object with CLSID: {00000010-0000-0010-8000-00AA00602EA4}

    how am i goona fix this thru my VB code (including other means)?
    waiting
    Nobody is smarter than all of us!

  12. #12
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: DAO and MS Access

    You can't fix it in code, you need to create an installation package for your program.

    You can use the Package & Deployment Wizard that comes with VB (it should be on your start menu), or one of the many alternatives (see our Application Deployment forum for details & advice).
    Last edited by si_the_geek; Apr 23rd, 2005 at 05:40 PM.

  13. #13

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

    Unhappy Re: DAO and MS Access

    Quote Originally Posted by si_the_geek
    You can't fix it in code, you need to create an installation package for your program.

    You can use the Package & Deployment Wizard that comes with VB (it should be on your start menu), or one of the many alternatives (see our Application Deployment forum for details & advice).
    something like using regserver from VB from the application is launched and un-register it when the application closes because the application will not be distributed as an installation but as a stand -alone EXE on a CDROM disk
    Nobody is smarter than all of us!

  14. #14
    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 oyad
    something like using regserver from VB from the application is launched and un-register it when the application closes because the application will not be distributed as an installation but as a stand -alone EXE on a CDROM disk
    This isn't going to work as you are finding out. You must create an installation package that will include all of the dependancy files required by your .Exe or the program will never, ever, run.

    The installation package, not the .Exe should be on the CD, and the customer should be provided with instructions on how to run the install.

  15. #15

    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 Hack
    This isn't going to work as you are finding out. You must create an installation package that will include all of the dependancy files required by your .Exe or the program will never, ever, run.

    The installation package, not the .Exe should be on the CD, and the customer should be provided with instructions on how to run the install.
    hi, plz can u help, i just discovered that the rest app had similar problems-like error-one of its dependences not file or missing file , for tabctl32.ocx,winsock.ocx,flxgrd.ocx etc. any tip or solution.
    plz, am waiting!
    oyad
    Nobody is smarter than all of us!

  16. #16
    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

    Like Hack suggested, you need to create an installation package. You can use the P&D Wizard that
    comes with VB to create one or download one from the Application Deployment FAQ forum.
    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