DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   Visual Basic 4 / 5 / 6 (http://www.daniweb.com/forums/forum4.html)
-   -   About Updating a Record in adodb (http://www.daniweb.com/forums/thread160244.html)

aktharshaik Dec 2nd, 2008 10:17 am
Re: About Updating a Record in adodb
 
All the fields in the Deliver table are Text except for the Date Field.

"Insert Into Deliver (scode, pcode, quantity, unit, amount, pcarrier, pterms, drnumber, date) Values ('" + Combo1.Text + "','" + Combo2.Text + "','" + Text1.Text + "','" + Text2.Text + "','" + Text3.Text + "','" + Text4.Text + "','" + Text5.Text + "','" + Text6.Text + "',#" + Text7.Text + "#)"

ryan311 Dec 2nd, 2008 10:21 am
Re: About Updating a Record in adodb
 
cn.execute "insert into? right?

aktharshaik Dec 2nd, 2008 10:26 am
Re: About Updating a Record in adodb
 
Hey Got the problem.

Actually the field with the name "date" is actually a reserved keyword.

just put square brackets around that field in the query.

her it is
"Insert Into Deliver (scode, pcode, quantity, unit, amount, pcarrier, pterms, drnumber, [date]) Values ('" + Combo1.Text + "','" + Combo2.Text + "','" + Text1.Text + "','" + Text2.Text + "','" + Text3.Text + "','" + Text4.Text + "','" + Text5.Text + "','" + Text6.Text + "',#" + Text7.Text + "#)"

aktharshaik Dec 2nd, 2008 10:28 am
Re: About Updating a Record in adodb
 
a better suggestion is change the name of the field in every table with the fieldname "date" as "mdate" or "edate" or "ddate" or anything else , other than the spelling "date"

ryan311 Dec 2nd, 2008 11:25 am
Re: About Updating a Record in adodb
 
thank you so much shaik akthar it helps a lot of me thanks! god bless u!

aktharshaik Dec 2nd, 2008 3:08 pm
Re: About Updating a Record in adodb
 
If ur problem is solved then Mark the thread as solved, b'cos it may help even the others to search for similar problem and those threads having the notation of solved.


All times are GMT -4. The time now is 1:28 am.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC