THANKS
"Jet OLEDB:Database Password" is key of this problem.
Thanks
Mirko
"Marko ®nidar" <ma**********@triera.net> wrote in message news:ck*********@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" <ab******@yahoo.com> je napisal v sporočilo news:u4**************@tk2msftngp13.phx.gbl ...
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