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. VB.NET accessing MS Access with password problem... [modified]

VB.NET accessing MS Access with password problem... [modified]

Scheduled Pinned Locked Moved Visual Basic
databasehelpcsharpsql-server
10 Posts 3 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.
  • L Offline
    L Offline
    lordkaile
    wrote on last edited by
    #1

    Greetings everyone! i'm a junior programmer of VBNET.. I don't have an SQL Server and im still not into hard coding SQL... so i'm using MS access as my database.. The problem is, i like to set a password on my database..let's say 'depedsys.mdb' is my database file.. but if i set a password in it.. can't access it on VBNET.. Im using the Microsoft JET Oledb 4.0 Provider.. Anyone can help me out with this? Thanks in advance.. -Kai Kai Studios -- modified at 0:28 Sunday 30th July, 2006 Kai Studios

    G S 2 Replies Last reply
    0
    • L lordkaile

      Greetings everyone! i'm a junior programmer of VBNET.. I don't have an SQL Server and im still not into hard coding SQL... so i'm using MS access as my database.. The problem is, i like to set a password on my database..let's say 'depedsys.mdb' is my database file.. but if i set a password in it.. can't access it on VBNET.. Im using the Microsoft JET Oledb 4.0 Provider.. Anyone can help me out with this? Thanks in advance.. -Kai Kai Studios -- modified at 0:28 Sunday 30th July, 2006 Kai Studios

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      Specify the user name "admin" and the password in the connection string. Example: "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\somepath\mydb.mdb;User Id=admin;Password=whatever"

      --- b { font-weight: normal; }

      L 1 Reply Last reply
      0
      • L lordkaile

        Greetings everyone! i'm a junior programmer of VBNET.. I don't have an SQL Server and im still not into hard coding SQL... so i'm using MS access as my database.. The problem is, i like to set a password on my database..let's say 'depedsys.mdb' is my database file.. but if i set a password in it.. can't access it on VBNET.. Im using the Microsoft JET Oledb 4.0 Provider.. Anyone can help me out with this? Thanks in advance.. -Kai Kai Studios -- modified at 0:28 Sunday 30th July, 2006 Kai Studios

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

        Try this for your connection string: "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\path\myDB.mdb;Jet OLEDB:Database Password=myPassword" If the database is located in the application folder, you could use: "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Application.StartupPath & "\myDB.mdb;Jet OLEDB:Database Password=myPassword" Steve

        L 1 Reply Last reply
        0
        • S Stephen McGuire

          Try this for your connection string: "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\path\myDB.mdb;Jet OLEDB:Database Password=myPassword" If the database is located in the application folder, you could use: "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Application.StartupPath & "\myDB.mdb;Jet OLEDB:Database Password=myPassword" Steve

          L Offline
          L Offline
          lordkaile
          wrote on last edited by
          #4

          I always put my database inside the bin or in a folder inside the bin.. i'll try your connection string, thanks! :) -Kai

          S 1 Reply Last reply
          0
          • G Guffa

            Specify the user name "admin" and the password in the connection string. Example: "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\somepath\mydb.mdb;User Id=admin;Password=whatever"

            --- b { font-weight: normal; }

            L Offline
            L Offline
            lordkaile
            wrote on last edited by
            #5

            Thanks for the answer.. but the user id and password pertains to a SQL server... i think.. i've tried that b4.. and the password isn't the password of the access database.. -Kai

            G 1 Reply Last reply
            0
            • L lordkaile

              I always put my database inside the bin or in a folder inside the bin.. i'll try your connection string, thanks! :) -Kai

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

              If your DB is in the bin folder you could use: "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Application.StartupPath & "\bin\myDB.mdb;Jet OLEDB:Database Password=myPassword" This will be ok during development but when you deploy your app this connection string will not work unless you install your DB to a bin folder under your app folder. Most likely you will need to change it at the deployment stage to: "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Application.StartupPath & "\myDB.mdb;Jet OLEDB:Database Password=myPassword" ...if the DB is installed to the app folder. Otherwise you will have to change the 'Data Source=' to point to the actual folder that contains your back-end DB. Steve

              L 1 Reply Last reply
              0
              • L lordkaile

                Thanks for the answer.. but the user id and password pertains to a SQL server... i think.. i've tried that b4.. and the password isn't the password of the access database.. -Kai

                G Offline
                G Offline
                Guffa
                wrote on last edited by
                #7

                Why do you think so? That connection string is not for SQL Server, it's for Access.

                --- b { font-weight: normal; }

                L 1 Reply Last reply
                0
                • G Guffa

                  Why do you think so? That connection string is not for SQL Server, it's for Access.

                  --- b { font-weight: normal; }

                  L Offline
                  L Offline
                  lordkaile
                  wrote on last edited by
                  #8

                  i have tried it b4 and it's really not for access, in the first place setting password to an access database does not require username..and if u use the password with the username, it will juz prompt an invalid password.. it's alright, thanks anyway : )

                  1 Reply Last reply
                  0
                  • S Stephen McGuire

                    If your DB is in the bin folder you could use: "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Application.StartupPath & "\bin\myDB.mdb;Jet OLEDB:Database Password=myPassword" This will be ok during development but when you deploy your app this connection string will not work unless you install your DB to a bin folder under your app folder. Most likely you will need to change it at the deployment stage to: "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Application.StartupPath & "\myDB.mdb;Jet OLEDB:Database Password=myPassword" ...if the DB is installed to the app folder. Otherwise you will have to change the 'Data Source=' to point to the actual folder that contains your back-end DB. Steve

                    L Offline
                    L Offline
                    lordkaile
                    wrote on last edited by
                    #9

                    Steve! i've tried your connection string and it worked! Thanks a lot man! now i dont have to worry about my database being vulnerable..! Thanks for the help! :) -Kai

                    S 1 Reply Last reply
                    0
                    • L lordkaile

                      Steve! i've tried your connection string and it worked! Thanks a lot man! now i dont have to worry about my database being vulnerable..! Thanks for the help! :) -Kai

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

                      Great! Pleased to help. Be aware that Access databases are not that secure. A utility available on the Internet for about $45.00 can break the pasword protection. Access DB's are great for doing a lot of things but if security is a real issue, you would be better to choose SQL Server or another more secure database model. Steve

                      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