JackBurton07
IS-IT--Management
Hi All,
I just cant seem to get this to work??
private void button1_Click(object sender, EventArgs e)
{
//The connection string is used to describe the type of database, the security information and the location to the database.
string ConnStr = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\resources\pw.accdb;Jet OLEDBatabase Password=password";
//Create a new connection object and assign the ConString Connection String above
OleDbConnection DBCon = new OleDbConnection(ConnStr);
string strUsername = this.txtUN.Text;
string strPassword = this.txtPW.Text;
if (strUsername == "" || strPassword == "")
{
MessageBox.Show("You are missing information. Please make sure that both the username and password fields are filled out.", "Missing Info");
this.txtUN.Focus();
return;
}
// Conn String to Access 2007 DB
string strsql = "SELECT [UserID], [Password] FROM USES WHERE [UserID]='" + this.txtUN + "'[Password]="+ this.txtPW+"";
Form1.Show
I just cant seem to get this to work??
private void button1_Click(object sender, EventArgs e)
{
//The connection string is used to describe the type of database, the security information and the location to the database.
string ConnStr = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\resources\pw.accdb;Jet OLEDBatabase Password=password";
//Create a new connection object and assign the ConString Connection String above
OleDbConnection DBCon = new OleDbConnection(ConnStr);
string strUsername = this.txtUN.Text;
string strPassword = this.txtPW.Text;
if (strUsername == "" || strPassword == "")
{
MessageBox.Show("You are missing information. Please make sure that both the username and password fields are filled out.", "Missing Info");
this.txtUN.Focus();
return;
}
// Conn String to Access 2007 DB
string strsql = "SELECT [UserID], [Password] FROM USES WHERE [UserID]='" + this.txtUN + "'[Password]="+ this.txtPW+"";
Form1.Show