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 1st, 2008 10:43 am
Re: About Updating a Record in adodb
 
ur code 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 + ")"

I assume scode, pcode, unit, pcarrier, pterms, drnumber, date are Text fields
and quantity, amount are Numeric fields
hence
"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 + "')"

also remove the
, cn, adOpenKeyset, adLockPessimistic
in the insert statement.

Regards
Shaik Akthar

ryan311 Dec 1st, 2008 10:50 am
Re: About Updating a Record in adodb
 
syntax error in inert into

aktharshaik Dec 1st, 2008 10:52 am
Re: About Updating a Record in adodb
 
what is the datatype of the field 'date' in your database and is it MS-Access Database?

aktharshaik Dec 1st, 2008 10:53 am
Re: About Updating a Record in adodb
 
just once give me all the fields with their datatypes with which they exist in the database in the table Deliver

ryan311 Dec 2nd, 2008 9:36 am
Re: About Updating a Record in adodb
 
the date is Date/time and the rest is text

aktharshaik Dec 2nd, 2008 9:41 am
Re: About Updating a Record in adodb
 
If the database is MS-Access u have to use a # for date field.
It goes like this. replace the query with this one.
"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 9:57 am
Re: About Updating a Record in adodb
 
still having a error

synthax error in insert into, how can i upload my files here? can u fix it?

aktharshaik Dec 2nd, 2008 10:02 am
Re: About Updating a Record in adodb
 
just zip the access database file and the vbform.

Click on Reply to Thread button. do not post in quick reply.
below the reply box u can find the button for attachments. there u select the zip file and upload it.

aktharshaik Dec 2nd, 2008 10:06 am
Re: About Updating a Record in adodb
 
1 Attachment(s)
i have enclosed a screenshot of the reply screen

ryan311 Dec 2nd, 2008 10:11 am
Re: About Updating a Record in adodb
 
1 Attachment(s)
here it is!


All times are GMT -4. The time now is 9:30 pm.

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