Connecting Tech Pros Worldwide Forums | Help | Site Map

MS ACCess DB openning with password

ablyplus
Guest
 
Posts: n/a
#1: Nov 16 '05
Hi,

I am trying to open MS Access DB with c# like follows...

OleDbConnection thisConnection = new OleDbConnection(
@"Provider=Microsoft.Jet.OLEDB.4.0;" +
@"Data Source=" +
@"..\..\hren.mdb;" +
@"User Id=Admin;" +
@"Password=xxxxx123"
);
Error description:
Cannot start your application. The workgroup information file is missing or
opened exclusively by another user.

It does not works. Do you know why? I can tell you that db is not opened by
another user.

Thanks in advance




Mark Rae
Guest
 
Posts: n/a
#2: Nov 16 '05

re: MS ACCess DB openning with password


"ablyplus" <ablyplus@yahoo.com> wrote in message
news:u4INDnprEHA.2000@tk2msftngp13.phx.gbl...
[color=blue]
> It does not works. Do you know why?[/color]

http://www.andreavb.com/forum/viewtopic_3628.html


ablyplus
Guest
 
Posts: n/a
#3: Nov 16 '05

re: MS ACCess DB openning with password


Thanks, I appreciate your help, but I unfortunately I still do not
understand how it goes.

Thanks again.

"Mark Rae" <mark@mark-N-O-S-P-A-M-rae.co.uk> wrote in message
news:uTpQo$prEHA.2636@TK2MSFTNGP09.phx.gbl...[color=blue]
> "ablyplus" <ablyplus@yahoo.com> wrote in message
> news:u4INDnprEHA.2000@tk2msftngp13.phx.gbl...
>[color=green]
>> It does not works. Do you know why?[/color]
>
> http://www.andreavb.com/forum/viewtopic_3628.html
>[/color]


Mark Rae
Guest
 
Posts: n/a
#4: Nov 16 '05

re: MS ACCess DB openning with password


"ablyplus" <ablyplus@yahoo.com> wrote in message
news:OadWn9qrEHA.3252@TK2MSFTNGP14.phx.gbl...
[color=blue]
> Thanks, I appreciate your help, but I unfortunately I still do not
> understand how it goes.[/color]

OK. Access has two "types" of security: a file password (like Word, Excel
etc) and workgroup security which means that the .mdb file was created under
a secure workgroup.

How would you open this Access database from within Access, not through
C#...?


ablyplus
Guest
 
Posts: n/a
#5: Nov 16 '05

re: MS ACCess DB openning with password


Thanks for answer.

The basic idea is to protect DB and data's from unauthorized access. I have
put password there and now I need to open that within c#.



I have tried to use code showed in previous message. I am not sure what you
exactly mean when saying "How would you open this Access database from
within Access". I am not sure how my data base has created. I have made it
normally within MS Access without any additions.



I would like to give you proper answers but I am not sure how.



Example you send is description of problem what I have, but I am not sure
how I can use it.



Thanks for understanding and help. i beleive you can help me to resolve this
problem. Thanks.



"Mark Rae" <mark@mark-N-O-S-P-A-M-rae.co.uk> wrote in message
news:eS5vFtrrEHA.736@tk2msftngp13.phx.gbl...[color=blue]
> "ablyplus" <ablyplus@yahoo.com> wrote in message
> news:OadWn9qrEHA.3252@TK2MSFTNGP14.phx.gbl...
>[color=green]
>> Thanks, I appreciate your help, but I unfortunately I still do not
>> understand how it goes.[/color]
>
> OK. Access has two "types" of security: a file password (like Word, Excel
> etc) and workgroup security which means that the .mdb file was created
> under a secure workgroup.
>
> How would you open this Access database from within Access, not through
> C#...?
>[/color]


Mark Rae
Guest
 
Posts: n/a
#6: Nov 16 '05

re: MS ACCess DB openning with password


"ablyplus" <ablyplus@yahoo.com> wrote in message
news:uE8Pb3urEHA.3848@TK2MSFTNGP14.phx.gbl...
[color=blue]
> I have tried to use code showed in previous message. I am not sure what
> you exactly mean when saying "How would you open this Access database from
> within Access". I am not sure how my data base has created. I have made it
> normally within MS Access without any additions.[/color]

OK - a priori. You say "I have made it normally within MS Access without any
additions". From that, I deduce that you have a copy of MS Access installed
on your PC. When you start MS Access, are you prompted for a workgroup
username and password i.e. are you working within a secure workgroup or are
you using the default (unsecure) workgroup?

Then, when you open this database from within Access (File, Open etc) are
you prompted for a file password?


Marko Žnidar
Guest
 
Posts: n/a
#7: Nov 16 '05

re: MS ACCess DB openning with password


Hey there i had the same problems... and i foud a solution.

I have protected my database under access by clicking Tools->Security->Set database password.

Then in c# when i added a new oledbAdapter on my form i made a new connection.

In the DataLink properties dialogbox under the tab All i double clicked Jet OLEDB: Database Password and set my password again there. Then i searched my disk for the file system.mdw and copyed it in /bin/debug or /bin/Release in my project folder. i passed the path by double clicking the Jet OLEDB: System database in the DataLink properties (tab all) dialog box (see text above).
I tested the connection and it worked fine. When initializing your connection (i do that in the constructor method) i added:

string dat = Application.StartupPath+\\MyAccessDatabase.mdw;

string str = "Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Data Source="+dat+";Jet OLEDB:Database Password=sbvHdpcl; Jet OLEDB:System database="+Application.StartupPath+\\System.mdw;;

myOleDbConnection.ConnectionString = str;

i use the variable dat because my app changes the connection at runtime....

The files MyAccessDatabase.mdb and System.mdw has to be in /bin/debug or /bin/release folded in your project folder.

It works fine for me... i hope i could help u out... and sorry for my english :)

Marko

"ablyplus" <ablyplus@yahoo.com> je napisal v sporočilo news:u4INDnprEHA.2000@tk2msftngp13.phx.gbl ...[color=blue]
> Hi,
>
> I am trying to open MS Access DB with c# like follows...
>
> OleDbConnection thisConnection = new OleDbConnection(
> @"Provider=Microsoft.Jet.OLEDB.4.0;" +
> @"Data Source=" +
> @"..\..\hren.mdb;" +
> @"User Id=Admin;" +
> @"Password=xxxxx123"
> );
> Error description:
> Cannot start your application. The workgroup information file is missing or
> opened exclusively by another user.
>
> It does not works. Do you know why? I can tell you that db is not opened by
> another user.
>
> Thanks in advance
>
>
>[/color]
ablyplus
Guest
 
Posts: n/a
#8: Nov 16 '05

re: MS ACCess DB openning with password


When I start MS Access I am prompted only for password. There is no question
like workgroup...
And yes, my db is installed locally on my desk top.

Thanks

"Mark Rae" <mark@mark-N-O-S-P-A-M-rae.co.uk> wrote in message
news:u71ZLZ2rEHA.3728@TK2MSFTNGP09.phx.gbl...[color=blue]
> "ablyplus" <ablyplus@yahoo.com> wrote in message
> news:uE8Pb3urEHA.3848@TK2MSFTNGP14.phx.gbl...
>[color=green]
>> I have tried to use code showed in previous message. I am not sure what
>> you exactly mean when saying "How would you open this Access database
>> from within Access". I am not sure how my data base has created. I have
>> made it normally within MS Access without any additions.[/color]
>
> OK - a priori. You say "I have made it normally within MS Access without
> any additions". From that, I deduce that you have a copy of MS Access
> installed on your PC. When you start MS Access, are you prompted for a
> workgroup username and password i.e. are you working within a secure
> workgroup or are you using the default (unsecure) workgroup?
>
> Then, when you open this database from within Access (File, Open etc) are
> you prompted for a file password?
>[/color]


ablyplus
Guest
 
Posts: n/a
#9: Nov 16 '05

re: MS ACCess DB openning with password


THANKS

"Jet OLEDB:Database Password" is key of this problem.

Thanks

Mirko

"Marko Žnidar" <marko.znidar@triera.net> wrote in message news:ckddld02kih@enews1.newsguy.com...
Hey there i had the same problems... and i foud a solution.

I have protected my database under access by clicking Tools->Security->Set database password.

Then in c# when i added a new oledbAdapter on my form i made a new connection.

In the DataLink properties dialogbox under the tab All i double clicked Jet OLEDB: Database Password and set my password again there. Then i searched my disk for the file system.mdw and copyed it in /bin/debug or /bin/Release in my project folder. i passed the path by double clicking the Jet OLEDB: System database in the DataLink properties (tab all) dialog box (see text above).
I tested the connection and it worked fine. When initializing your connection (i do that in the constructor method) i added:

string dat = Application.StartupPath+\\MyAccessDatabase.mdw;

string str = "Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Data Source="+dat+";Jet OLEDB:Database Password=sbvHdpcl; Jet OLEDB:System database="+Application.StartupPath+\\System.mdw;;

myOleDbConnection.ConnectionString = str;

i use the variable dat because my app changes the connection at runtime....

The files MyAccessDatabase.mdb and System.mdw has to be in /bin/debug or /bin/release folded in your project folder.

It works fine for me... i hope i could help u out... and sorry for my english :)

Marko

"ablyplus" <ablyplus@yahoo.com> je napisal v sporočilo news:u4INDnprEHA.2000@tk2msftngp13.phx.gbl ...[color=blue]
> Hi,
>
> I am trying to open MS Access DB with c# like follows...
>
> OleDbConnection thisConnection = new OleDbConnection(
> @"Provider=Microsoft.Jet.OLEDB.4.0;" +
> @"Data Source=" +
> @"..\..\hren.mdb;" +
> @"User Id=Admin;" +
> @"Password=xxxxx123"
> );
> Error description:
> Cannot start your application. The workgroup information file is missing or
> opened exclusively by another user.
>
> It does not works. Do you know why? I can tell you that db is not opened by
> another user.
>
> Thanks in advance
>
>
>[/color]
Closed Thread