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. Accessing a password protected MS Access File

Accessing a password protected MS Access File

Scheduled Pinned Locked Moved Visual Basic
databasehelpquestion
14 Posts 5 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.
  • I Offline
    I Offline
    icowa
    wrote on last edited by
    #1

    Hi all, ok, as the subject stated, I am trying to make my form link up to a Ms Access file that is password protected. I tried linking using oledbdataadaper1 on a un-protected MS Access file and it works fine, I can access the inside DB and all. But when I put a password into that Access File, I cannot get my form to link up to it. It came out a message saying 'Test connection failed because of an error initializing provider'. I put the username as Admin and the password I put in for the Access file, but still this error... Anyone have any idea where I went wrong.? Thanz..

    D I 2 Replies Last reply
    0
    • I icowa

      Hi all, ok, as the subject stated, I am trying to make my form link up to a Ms Access file that is password protected. I tried linking using oledbdataadaper1 on a un-protected MS Access file and it works fine, I can access the inside DB and all. But when I put a password into that Access File, I cannot get my form to link up to it. It came out a message saying 'Test connection failed because of an error initializing provider'. I put the username as Admin and the password I put in for the Access file, but still this error... Anyone have any idea where I went wrong.? Thanz..

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      In the connection string, you have to supply a User Id, Password, and possibly the System Database path that holds the workgroup security information. I really can't tell you for sure because I stopped using Access for all of my database work years ago. Just a little sample:

      "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\MyDb.mdb;Jet OLEDB:System Database=C:\MySystemDB.mdw"

      RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

      I 1 Reply Last reply
      0
      • D Dave Kreskowiak

        In the connection string, you have to supply a User Id, Password, and possibly the System Database path that holds the workgroup security information. I really can't tell you for sure because I stopped using Access for all of my database work years ago. Just a little sample:

        "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\MyDb.mdb;Jet OLEDB:System Database=C:\MySystemDB.mdw"

        RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

        I Offline
        I Offline
        icowa
        wrote on last edited by
        #3

        Hmm, didn't really help there since I am using the oledbdataadapter wizard to link to my MS Access file.. Anyone else who got any idea to my situation..? Thanz anyway, Dave. P.S :- You mentioned that u are not using Access years ago... What are you using now to keep your data and all.. Can it be password protected? If so, I might want to look into it...

        Y D 2 Replies Last reply
        0
        • I icowa

          Hi all, ok, as the subject stated, I am trying to make my form link up to a Ms Access file that is password protected. I tried linking using oledbdataadaper1 on a un-protected MS Access file and it works fine, I can access the inside DB and all. But when I put a password into that Access File, I cannot get my form to link up to it. It came out a message saying 'Test connection failed because of an error initializing provider'. I put the username as Admin and the password I put in for the Access file, but still this error... Anyone have any idea where I went wrong.? Thanz..

          I Offline
          I Offline
          icowa
          wrote on last edited by
          #4

          Is there no one who can help me on this area?

          J C 2 Replies Last reply
          0
          • I icowa

            Hmm, didn't really help there since I am using the oledbdataadapter wizard to link to my MS Access file.. Anyone else who got any idea to my situation..? Thanz anyway, Dave. P.S :- You mentioned that u are not using Access years ago... What are you using now to keep your data and all.. Can it be password protected? If so, I might want to look into it...

            Y Offline
            Y Offline
            Yulianto
            wrote on last edited by
            #5

            icowa wrote: What are you using now to keep your data and all He might be using SQL Server. icowa wrote: Can it be password protected? You can use a combination of user name and password to access the data.


            Work hard, Work effectively.

            1 Reply Last reply
            0
            • I icowa

              Is there no one who can help me on this area?

              J Offline
              J Offline
              jonathan15
              wrote on last edited by
              #6

              You said the database is password protected. How is it protected? In Access there are 2 ways to protect a database. 1 is by setting the database password (this will simply prompt for a password when you try to open the db), the other is by setting up users and using a workgroup database to store this info. How you access the DB in code will depend on which method used. Jon

              I 1 Reply Last reply
              0
              • I icowa

                Is there no one who can help me on this area?

                C Offline
                C Offline
                Colin Angus Mackay
                wrote on last edited by
                #7

                icowa wrote: Is there no one who can help me on this area? Have patience. You got an initial reply in 4 hours and you posted this after 8 hours. That isn't too bad considering how much this service is costing you (i.e. nothing). Everyone who responds here are volunteers. If you need a fast solution to your problem then you can always open a support incident with Microsoft. Anyway, to your problem. First, try not to use the wizards - if you feel you must, at least look at the code they generate. You can look at the code the wizard generates and modify the connection string. Dave already suggested one. You can find more examples at http://www.connectionstrings.com/[^]


                My: Blog | Photos WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More

                D 1 Reply Last reply
                0
                • I icowa

                  Hmm, didn't really help there since I am using the oledbdataadapter wizard to link to my MS Access file.. Anyone else who got any idea to my situation..? Thanz anyway, Dave. P.S :- You mentioned that u are not using Access years ago... What are you using now to keep your data and all.. Can it be password protected? If so, I might want to look into it...

                  D Offline
                  D Offline
                  Dave Kreskowiak
                  wrote on last edited by
                  #8

                  If your using the Wizard to generate the OleDb code, then I think you're out of luck using a password protected Access database. I found the code the Wizards generated to much of a pain to maintain, so I would HIGHLY recommend writing the code by hand. It's much easier to maintain, by FAR, much easier to ask questions about in the forums, much easier to debug, and it gives you much greater control over how your code runs. I use MSDE and SQL Server. Both of which has security FAR better than anything you'll find in Access. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

                  I 1 Reply Last reply
                  0
                  • C Colin Angus Mackay

                    icowa wrote: Is there no one who can help me on this area? Have patience. You got an initial reply in 4 hours and you posted this after 8 hours. That isn't too bad considering how much this service is costing you (i.e. nothing). Everyone who responds here are volunteers. If you need a fast solution to your problem then you can always open a support incident with Microsoft. Anyway, to your problem. First, try not to use the wizards - if you feel you must, at least look at the code they generate. You can look at the code the wizard generates and modify the connection string. Dave already suggested one. You can find more examples at http://www.connectionstrings.com/[^]


                    My: Blog | Photos WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More

                    D Offline
                    D Offline
                    Dave Kreskowiak
                    wrote on last edited by
                    #9

                    :doh: I completely forgot about that site! Thanks Colin! RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

                    1 Reply Last reply
                    0
                    • J jonathan15

                      You said the database is password protected. How is it protected? In Access there are 2 ways to protect a database. 1 is by setting the database password (this will simply prompt for a password when you try to open the db), the other is by setting up users and using a workgroup database to store this info. How you access the DB in code will depend on which method used. Jon

                      I Offline
                      I Offline
                      icowa
                      wrote on last edited by
                      #10

                      My password protection for the MS Access file is the one you have to key in whenever u open the file..

                      1 Reply Last reply
                      0
                      • D Dave Kreskowiak

                        If your using the Wizard to generate the OleDb code, then I think you're out of luck using a password protected Access database. I found the code the Wizards generated to much of a pain to maintain, so I would HIGHLY recommend writing the code by hand. It's much easier to maintain, by FAR, much easier to ask questions about in the forums, much easier to debug, and it gives you much greater control over how your code runs. I use MSDE and SQL Server. Both of which has security FAR better than anything you'll find in Access. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

                        I Offline
                        I Offline
                        icowa
                        wrote on last edited by
                        #11

                        mmm, I was afraid you'll say that. The part about vb.net not being able to access a password protected Access file. Yea, I read a lot of PDF files on this sql but not a one of them is very intuitive on how you go and create a SQL Db and accessing it and providing it with password and all. Thats what made me go and figure out on Access on the first place. Since I search throughout the net before and not having much luck, do you know of any sites or maybe you have any PDF files that is good in teaching u on SQL. Preferably with good DIY step by step instructions... Thanz

                        D 1 Reply Last reply
                        0
                        • I icowa

                          mmm, I was afraid you'll say that. The part about vb.net not being able to access a password protected Access file. Yea, I read a lot of PDF files on this sql but not a one of them is very intuitive on how you go and create a SQL Db and accessing it and providing it with password and all. Thats what made me go and figure out on Access on the first place. Since I search throughout the net before and not having much luck, do you know of any sites or maybe you have any PDF files that is good in teaching u on SQL. Preferably with good DIY step by step instructions... Thanz

                          D Offline
                          D Offline
                          Dave Kreskowiak
                          wrote on last edited by
                          #12

                          icowa wrote: The part about vb.net not being able to access a password protected Access file. I didn't say it couldn't access a password protected Access file. I said it wasn't supportable in the forums because the Wizard is completely visual. It's FAR easier to deal with code that is hand written then it is to deal with the stuff that the Wizard generates. icowa wrote: Since I search throughout the net before and not having much luck, do you know of any sites or maybe you have any PDF files that is good in teaching u on SQL. Preferably with good DIY step by step instructions I don't have anything. I taught myself SQL Server straight out of the Administrators manuals. There's no such thing as adding a single password to an SQL Server database. Each SQL Server can maintain it's own users and groups. You can give each user/group rights to specific databases, tables, procedures, ... Right down to even who can execute which procedures and who can can cannot read/write whatever tables in the databases. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

                          I 1 Reply Last reply
                          0
                          • D Dave Kreskowiak

                            icowa wrote: The part about vb.net not being able to access a password protected Access file. I didn't say it couldn't access a password protected Access file. I said it wasn't supportable in the forums because the Wizard is completely visual. It's FAR easier to deal with code that is hand written then it is to deal with the stuff that the Wizard generates. icowa wrote: Since I search throughout the net before and not having much luck, do you know of any sites or maybe you have any PDF files that is good in teaching u on SQL. Preferably with good DIY step by step instructions I don't have anything. I taught myself SQL Server straight out of the Administrators manuals. There's no such thing as adding a single password to an SQL Server database. Each SQL Server can maintain it's own users and groups. You can give each user/group rights to specific databases, tables, procedures, ... Right down to even who can execute which procedures and who can can cannot read/write whatever tables in the databases. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

                            I Offline
                            I Offline
                            icowa
                            wrote on last edited by
                            #13

                            ouch, then i am stuck..

                            D 1 Reply Last reply
                            0
                            • I icowa

                              ouch, then i am stuck..

                              D Offline
                              D Offline
                              Dave Kreskowiak
                              wrote on last edited by
                              #14

                              No, you learn how to write the code yourself instead of having a Wizard mess it up for you. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

                              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