Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB8.0
Hello

Can someone help me to open a Access database (protected with a password) in
my application in Visual Basic 2008. I use Oledb connection to link my Application
to the database. When my Access database is not protected with password
my connection goes well, but I don't know how to set my password of my database
in my application.
I have "googled", but I can't find something that works for me. Pleas Help! Cry | :((
 
That's the code that I have at moment:
 
Dim connectiestring As String
connectiestring = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source='" & My.Settings.LocatieDB & "'"
Dim connectie As New OleDb.OleDbConnection(connectiestring)
Dim SQLcommand As New OleDb.OleDbCommand
connectie.Open()
SQLcommand.Connection = connectie
connectie.Close()
Posted 1-Jun-10 13:55pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

This should answer your question
http://support.microsoft.com/kb/191754
  Permalink  
Comments
William Winner at 2-Jun-10 11:56am
   
Yep...if you used Security-->Set Database Password, you have to include "Jet OLEDB:Database Password=password" in the connection string.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Have you tried adding ";Password=password;" to the end of your "connectiestring"?
 
Is it secured with a database level password or a Workgroup? If it is a workgroup you would probably have to provide the user as well so also add "User Id=whatevertheuseridis" to the connection string.
  Permalink  
Comments
William Winner at 2-Jun-10 11:54am
   
Reason for my vote of 2
password doesn't work with OLE for a database-wide password.
 
You have to use "Jet OLEDB:Database Password"

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 280
1 Jochen Arndt 150
2 Kornfeld Eliyahu Peter 120
3 PIEBALDconsult 110
4 Richard MacCutchan 105
0 OriginalGriff 6,055
1 DamithSL 4,621
2 Maciej Los 4,087
3 Kornfeld Eliyahu Peter 3,500
4 Sergey Alexandrovich Kryukov 3,294


Advertise | Privacy | Mobile
Web01 | 2.8.141220.1 | Last Updated 2 Jun 2010
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100