VB.NET accessing MS Access with password problem... [modified]
-
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
-
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
-
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
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
-
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
-
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; }
-
I always put my database inside the bin or in a folder inside the bin.. i'll try your connection string, thanks! :) -Kai
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
-
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
-
Why do you think so? That connection string is not for SQL Server, it's for Access.
--- b { font-weight: normal; }
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 : )
-
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
-
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
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