Click here to Skip to main content
11,706,142 members (49,319 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: VB8.0

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
SQLcommand.Connection = connectie
Posted 1-Jun-10 12:55pm
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

This should answer your question
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
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.
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 196
1 Sergey Alexandrovich Kryukov 151
2 ppolymorphe 61
3 Inimicos 60
4 ProgramFOX 50
0 OriginalGriff 9,050
1 Sergey Alexandrovich Kryukov 8,417
2 CPallini 5,189
3 Maciej Los 4,726
4 Mika Wendelius 3,636

Advertise | Privacy | Mobile
Web04 | 2.8.150819.1 | Last Updated 2 Jun 2010
Copyright © CodeProject, 1999-2015
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