update query in windows application with ms access as database
-
Hi I have a problem in my windows application with ms access 2007 as database. The problem is that the update query to change password is giving error. the code i used is string qry1 = "update log_in set password='" + txtnew.Text.Trim() + "' where userid='" + txtuser.Text + "'"; cmd = new OleDbCommand(qry1, con); cmd.ExecuteNonQuery(); MessageBox.Show("Password changes Sucessfully"); the error is "Syntax error in UPDATE statement." please answer. thanks in advance J.K.Sharma
-
Hi I have a problem in my windows application with ms access 2007 as database. The problem is that the update query to change password is giving error. the code i used is string qry1 = "update log_in set password='" + txtnew.Text.Trim() + "' where userid='" + txtuser.Text + "'"; cmd = new OleDbCommand(qry1, con); cmd.ExecuteNonQuery(); MessageBox.Show("Password changes Sucessfully"); the error is "Syntax error in UPDATE statement." please answer. thanks in advance J.K.Sharma
-
Hi I have a problem in my windows application with ms access 2007 as database. The problem is that the update query to change password is giving error. the code i used is string qry1 = "update log_in set password='" + txtnew.Text.Trim() + "' where userid='" + txtuser.Text + "'"; cmd = new OleDbCommand(qry1, con); cmd.ExecuteNonQuery(); MessageBox.Show("Password changes Sucessfully"); the error is "Syntax error in UPDATE statement." please answer. thanks in advance J.K.Sharma
If you let me use your application, I can erase your entire database. Try reading up on SQL injection attacks.
Christian Graus Driven to the arms of OSX by Vista. "! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums. I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
-
If you let me use your application, I can erase your entire database. Try reading up on SQL injection attacks.
Christian Graus Driven to the arms of OSX by Vista. "! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums. I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
-
password
is a reserved field name. Try changing your code to read:string qry1 = "update log_in set [password]='" + txtnew.Text.Trim() + "' where userid='" + txtuser.Text + "'";
oledbparameter..... :zzz:
-
password
is a reserved field name. Try changing your code to read:string qry1 = "update log_in set [password]='" + txtnew.Text.Trim() + "' where userid='" + txtuser.Text + "'";
Thank you so much . It works as per you advice.
-
password
is a reserved field name. Try changing your code to read:string qry1 = "update log_in set [password]='" + txtnew.Text.Trim() + "' where userid='" + txtuser.Text + "'";
when i create crystal report the database is at some location. but when i prepare setup of that windows application and deploy it on some other system then the path of database change and the crystal report does not load the correct database. Please help.. Thanks in advance.
-
when i create crystal report the database is at some location. but when i prepare setup of that windows application and deploy it on some other system then the path of database change and the crystal report does not load the correct database. Please help.. Thanks in advance.
-
Consider using an application configuration file to store your database path / connectionstring. take a look at one of my other replies: http://www.codeproject.com/Messages/3093473/Re-XML-Call-me-stupid-LOL.aspx[^] Hope this helps :)
Thanks for your suggestion I have used app.config file to store connection string for rest of my application but i am unable to create cyrstal report using that string. Because when I create crystal report i need to use database field from field explorer which are present only when i establish connection at creation time of crystal report. Is there any other way to generate crystal report so that i can use app.config connection string for that.
-
Thanks for your suggestion I have used app.config file to store connection string for rest of my application but i am unable to create cyrstal report using that string. Because when I create crystal report i need to use database field from field explorer which are present only when i establish connection at creation time of crystal report. Is there any other way to generate crystal report so that i can use app.config connection string for that.
Try something like this:
foreach ([forgot object name] tbl in CRReport.Database.Tables)
{
tbl.SetLogOnInfo("",dbLocation,dbUser,dbPass)
tbl.Location = dbLocation
tbl.SetDataSource(dbLocation)
}I've not got CR installed here, so can't double check the function and object names, but I believe that will redirect your database source for you :) The first parameter of "SetLogOnInfo" i think is a connection string, but I don't think you need this when reading from Access.. I've only ever used SQL Server, so I will say this is all just guess work :wtf: Anyways, hope it works for you! :cool: