Click here to Skip to main content
15,909,829 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Everyone,
I want to create ms-access file with user name and password using Jet.Oledb class in C#.

Thanks in advance!!
Posted

C#
using System;
using ADOX;

namespace ConsoleApplication1
{
    class Class1
    {
        [STAThread]
        static void Main(string[] args)
        {
          
ADOX._Catalog cat = new ADOX.Catalog();
cat.Create("Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDB:Database Password=pass;" +
       "Data Source=C:\\Docs\\Database.mdb;");
        }
    }
}


The default username is admin.
 
Share this answer
 
For this you have to set the password to your MS-Access file from Database Tools --> Set Database Password

And then follow the above solution provided by Chetan Ghorley...
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900