About UPDATE query

5 pts.
Tags:
Access 2003
Microsoft Access
RSS
VB 2008
Visual Basic 2008
hi friends , i am using VB 2008 . database access 2003 in my project , i include an update query,its below con.Open() Dim cmd As New OleDbCommand("update device set manu='" + mtxt.Text + "',desc='" + dtxt.Text + "',model='" + mdtxt.Text + "',pdate='" + prodate.Text + "',price='" + ptxt.Text + "'where ano='" + atxt.Text + "' ", con) cmd.ExecuteNonQuery() MessageBox.Show("UPDATED SUCCESSFULLY") con.Close() it has some errors during run time with Execute NonQuery
ASKED: November 5, 2008  4:09 PM
UPDATED: November 5, 2008  5:00 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.

<b>What are the error messages ?
<i>Providing more information will for sure lead to more useful responses</i>.</b>

From the code you pasted, I would check the following:

- You are using quotes for all of the values to update and the comparisons in the where clause. Make sure this is valid when comparing to some data types such as dates or numbers. You could have type mismatch errors.
- It seems that a space is needed before the WHERE keyword. This could work in some databases, but I’m not sure if it will work on access.

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following