0

HI ME AGAIN=|

I'm basically new to connecting to database.

MY PROBLEM is that i do not know how to connected to database[ microsoft access]

eg. the password entered, is stored at microsoft access database. how do i connect the window application to database so that when i run the window application the password enter and saved is store into the database. and we can refer to database to see if they have type the wrong password.

I'm kinda stuck here that i can't proceed with my projext so i desperately need some advice=| thankss=))

3
Contributors
2
Replies
4
Views
8 Years
Discussion Span
Last Post by Ramy Mahrous
0

I have posted a sample application using an SQL Connection, but you change the SqlConnection to OleDbConnection, SqlCommand to OleDbCommand, etc.
http://www.daniweb.com/code/snippet217409.html

For generating the access connection string:

public static string BuildAccessConnectionString(string Filename, string Username, string Password, string DatabasePassword)
    {
      return string.Format("Provider=Microsoft.Jet.OLEDB.4.0;Data Source='{0}';User Id={1};Password={2};Jet OLEDB:Database Password={3};",
                                   Filename.Replace("'", "''"),
                                   Username,
                                   Password,
                                   DatabasePassword);
    }
    public static string BuildAccess2007ConnectionString(string Filename, string DatabasePassword)
    {
      return string.Format("Provider=Microsoft.ACE.OLEDB.12.0;Data Source='{0}';Persist Security Info=False;Jet OLEDB:Database Password={1};",
                                 Filename.Replace("'", "''"),
                                 DatabasePassword);
    }
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.