Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: Help !This one is getting me mad!


Message #1 by "Eric Van Camp" <eric.vancamp@c...> on Wed, 13 Dec 2000 18:54:32 -0000
i use a sqlstring to insert into a table, written to the screen it looks

like:

UPDATE ENVELOPES set

envelopes.coyid='AMEEL',envelopes.envtypeid=,envelopes.size='',envelopes.win

dow='',envelopes.paper='',envelopes.flap='',envelopes.printcolors='',envelop

es.remarks='',envelopes.addressid=1,envelopes.tel='003216356999',envelopes.f

ax='',envelopes.btw='',envelopes.hr='',envelopes.b1='',envelopes.b2='',envel

opes.b3='',envelopes.b4='',envelopes.email='',envelopes.typeother='',envelop

es.actif=-1 where envelopes.envid=9

*********************

the original code is:

	strSQL="UPDATE BFORMS"&_

	" Set bforms.coyid='"& request.form("coyId") &

"',bforms.typeid='"&request.form("bformsid")&"',bforms.papertype='" &

request.form("typeid") & "', bforms.addressid="& request.form("addressid") &

", bforms.tel='" & strtel & "', bforms.fax='" & strfax & "', bforms.btw='"&

strbtw &"', bforms.hr='"& strhr & "' ,bforms.b1= '"& strb1 &"',bforms.b2='"&

strb2 &"' ,bforms.b3= '"& strb3 &"',bforms.b4='"& strb4 &"'

,bforms.description='"& request.form("description")&"' ,bforms.paper='"&

request.form("paper")&"' ,bforms.printcolors='"&

request.form("printcolors")&"' ,bforms.col1='"& request.form("col1")&"'

,bforms.col2= '"& request.form("col2")&"',bforms.col3= '"&

request.form("col3")&"',bforms.col4='"& request.form("col4")&"'

,bforms.col5='"&

request.form("col5")&"',bforms.actif="&stractif&",bforms.email='"&stremail&"

' where bforms.bformsid="&bformsid&""

*******************************



all varables which are not int are varchar and so there are some ''

inserted, that is all correct, although the error message i get is:

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'



[Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near

','.

so there is a comma somewhere that i missed???

can someone help me?





--- 

NEED TECHNICAL TIPS, TOOLS, AND INSIGHTS?  Is FREE okay?

Visit EarthWeb for the latest in IT Management, Software Development, 

Web Development, Networking & Communications, and Hardware & Systems.  

Click on http://www.earthweb.com for FREE articles, tutorials,

and discussions from the experts.

---

You are currently subscribed to asp_databases as: $subst('Recip.EmailAddr')

To unsubscribe send a blank email to leave-asp_databases-$subst('Recip.MemberIDChar')@p2p.wrox.com

Message #2 by "James Q. Stansfield" <jstansfield@t...> on Wed, 13 Dec 2000 14:44:05 -0500
	envelopes.envtypeid=,



	will cause that error. You should test your form for entries before trying

to write to the database. If you still want to write to the db even if a

field isn't filled in you should set it to zero if empty. If the column is

allows NULLs then just remove it from the SQL UPDATE command.



-----Original Message-----

From: Eric Van Camp [mailto:eric.vancamp@c...]

Sent: Wednesday, December 13, 2000 10:48 PM

To: ASP Databases

Subject: [asp_databases] Help !This one is getting me mad!





i use a sqlstring to insert into a table, written to the screen it looks

like:

UPDATE ENVELOPES set

envelopes.coyid='AMEEL',envelopes.envtypeid=,envelopes.size='',envelopes.win

dow='',envelopes.paper='',envelopes.flap='',envelopes.printcolors='',envelop

es.remarks='',envelopes.addressid=1,envelopes.tel='003216356999',envelopes.f

ax='',envelopes.btw='',envelopes.hr='',envelopes.b1='',envelopes.b2='',envel

opes.b3='',envelopes.b4='',envelopes.email='',envelopes.typeother='',envelop

es.actif=-1 where envelopes.envid=9

*********************

the original code is:

	strSQL="UPDATE BFORMS"&_

	" Set bforms.coyid='"& request.form("coyId") &

"',bforms.typeid='"&request.form("bformsid")&"',bforms.papertype='" &

request.form("typeid") & "', bforms.addressid="& request.form("addressid") &

", bforms.tel='" & strtel & "', bforms.fax='" & strfax & "', bforms.btw='"&

strbtw &"', bforms.hr='"& strhr & "' ,bforms.b1= '"& strb1 &"',bforms.b2='"&

strb2 &"' ,bforms.b3= '"& strb3 &"',bforms.b4='"& strb4 &"'

,bforms.description='"& request.form("description")&"' ,bforms.paper='"&

request.form("paper")&"' ,bforms.printcolors='"&

request.form("printcolors")&"' ,bforms.col1='"& request.form("col1")&"'

,bforms.col2= '"& request.form("col2")&"',bforms.col3= '"&

request.form("col3")&"',bforms.col4='"& request.form("col4")&"'

,bforms.col5='"&

request.form("col5")&"',bforms.actif="&stractif&",bforms.email='"&stremail&"

' where bforms.bformsid="&bformsid&""

*******************************



all varables which are not int are varchar and so there are some ''

inserted, that is all correct, although the error message i get is:

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'



[Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near

','.

so there is a comma somewhere that i missed???

can someone help me?





--- 

FREE SOFTWARE DEVELOPMENT CODE, CONTENT, AND

INSIGHTS IN YOUR INBOX!

Get the latest and best C++, Visual C++, Java, Visual Basic, and XML tips, tools, and 

developments from the experts.  Sign up for one or more of EarthWeb?s

FREE IT newsletters at http://www.earthweb.com today!  

---

You are currently subscribed to asp_databases as: $subst('Recip.EmailAddr')

To unsubscribe send a blank email to leave-asp_databases-$subst('Recip.MemberIDChar')@p2p.wrox.com

Message #3 by Imar Spaanjaars <Imar@S...> on Wed, 13 Dec 2000 21:04:01 +0100
Hi there,



I think you didn't supply a value for envtypeid.



If you break apart your SQL statement, you can see that there is no value 

assigned to it:



UPDATE ENVELOPES set

envelopes.coyid='AMEEL',

envelopes.envtypeid=,

envelopes.size='',

envelopes.window='',

envelopes.paper='',

envelopes.flap='',

envelopes.printcolors='',

envelopes.remarks='',

envelopes.addressid=1,

envelopes.tel='003216356999',

envelopes.fax='',

envelopes.btw='',

envelopes.hr='',

envelopes.b1='',

envelopes.b2='',

envelopes.b3='',

envelopes.b4='',

envelopes.email='',

envelopes.typeother='',

envelopes.actif=-1 where envelopes.envid=9



I am not quite sure if it applies to your situation, but usually you can 

leave out the envelopes, so your code will be more readable and 

maintainable (and saves your from typing a lot ;-))



HtH



Imar



P.S. Veel te laat om nog zo'n rottige komma te ontdekken, of niet ;-)





At 07:47 PM 12/13/2000 -0800, you wrote:

>i use a sqlstring to insert into a table, written to the screen it looks

>like:

>UPDATE ENVELOPES set

>envelopes.coyid='AMEEL',envelopes.envtypeid=,envelopes.size='',envelopes.win

>dow='',envelopes.paper='',envelopes.flap='',envelopes.printcolors='',envelop

>es.remarks='',envelopes.addressid=1,envelopes.tel='003216356999',envelopes.f

>ax='',envelopes.btw='',envelopes.hr='',envelopes.b1='',envelopes.b2='',envel

>opes.b3='',envelopes.b4='',envelopes.email='',envelopes.typeother='',envelop

>es.actif=-1 where envelopes.envid=9

>*********************

>the original code is:

>         strSQL="UPDATE BFORMS"&_

>         " Set bforms.coyid='"& request.form("coyId") &

>"',bforms.typeid='"&request.form("bformsid")&"',bforms.papertype='" &

>request.form("typeid") & "', bforms.addressid="& request.form("addressid") &

>", bforms.tel='" & strtel & "', bforms.fax='" & strfax & "', bforms.btw='"&

>strbtw &"', bforms.hr='"& strhr & "' ,bforms.b1= '"& strb1 &"',bforms.b2='"&

>strb2 &"' ,bforms.b3= '"& strb3 &"',bforms.b4='"& strb4 &"'

>,bforms.description='"& request.form("description")&"' ,bforms.paper='"&

>request.form("paper")&"' ,bforms.printcolors='"&

>request.form("printcolors")&"' ,bforms.col1='"& request.form("col1")&"'

>,bforms.col2= '"& request.form("col2")&"',bforms.col3= '"&

>request.form("col3")&"',bforms.col4='"& request.form("col4")&"'

>,bforms.col5='"&

>request.form("col5")&"',bforms.actif="&stractif&",bforms.email='"&stremail&"

>' where bforms.bformsid="&bformsid&""

>*******************************

>

>all varables which are not int are varchar and so there are some ''

>inserted, that is all correct, although the error message i get is:

>Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

>

>[Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near

>','.

>so there is a comma somewhere that i missed???

>can someone help me?

>





---

FREE WEB DEVELOPMENT CODE, CONTENT, AND INSIGHTS

IN YOUR INBOX!

Get the latest and best HTML, XML, and JavaScript tips, tools, and 

developments from the experts.  Sign up for one or more of EarthWeb's

FREE IT newsletters at http://www.earthweb.com today!  

---

You are currently subscribed to asp_databases as: $subst('Recip.EmailAddr')

To unsubscribe send a blank email to leave-asp_databases-$subst('Recip.MemberIDChar')@p2p.wrox.com

Message #4 by "Dallas Martin" <dmartin@z...> on Wed, 13 Dec 2000 20:01:46 -0500
Sure, your error is herer: envtypeid=,envelopes

envtypeid has no value.



----- Original Message -----

From: "Eric Van Camp" <eric.vancamp@c...>

To: "ASP Databases" <asp_databases@p...>

Sent: Wednesday, December 13, 2000 10:47 PM

Subject: [asp_databases] Help !This one is getting me mad!





> i use a sqlstring to insert into a table, written to the screen it looks

> like:

> UPDATE ENVELOPES set

>

envelopes.coyid='AMEEL',envelopes.envtypeid=,envelopes.size='',envelopes.win

>

dow='',envelopes.paper='',envelopes.flap='',envelopes.printcolors='',envelop

>

es.remarks='',envelopes.addressid=1,envelopes.tel='003216356999',envelopes.f

>

ax='',envelopes.btw='',envelopes.hr='',envelopes.b1='',envelopes.b2='',envel

>

opes.b3='',envelopes.b4='',envelopes.email='',envelopes.typeother='',envelop

> es.actif=-1 where envelopes.envid=9

> *********************

> the original code is:

> strSQL="UPDATE BFORMS"&_

> " Set bforms.coyid='"& request.form("coyId") &

> "',bforms.typeid='"&request.form("bformsid")&"',bforms.papertype='" &

> request.form("typeid") & "', bforms.addressid="& request.form("addressid")

&

> ", bforms.tel='" & strtel & "', bforms.fax='" & strfax & "',

bforms.btw='"&

> strbtw &"', bforms.hr='"& strhr & "' ,bforms.b1= '"& strb1

&"',bforms.b2='"&

> strb2 &"' ,bforms.b3= '"& strb3 &"',bforms.b4='"& strb4 &"'

> ,bforms.description='"& request.form("description")&"' ,bforms.paper='"&

> request.form("paper")&"' ,bforms.printcolors='"&

> request.form("printcolors")&"' ,bforms.col1='"& request.form("col1")&"'

> ,bforms.col2= '"& request.form("col2")&"',bforms.col3= '"&

> request.form("col3")&"',bforms.col4='"& request.form("col4")&"'

> ,bforms.col5='"&

>

request.form("col5")&"',bforms.actif="&stractif&",bforms.email='"&stremail&"

> ' where bforms.bformsid="&bformsid&""

> *******************************

>

> all varables which are not int are varchar and so there are some ''

> inserted, that is all correct, although the error message i get is:

> Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

>

> [Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax

near

> ','.

> so there is a comma somewhere that i missed???

> can someone help me?

>

>



---

FREE WEB DEVELOPMENT CODE, CONTENT, AND INSIGHTS

IN YOUR INBOX!

Get the latest and best HTML, XML, and JavaScript tips, tools, and 

developments from the experts.  Sign up for one or more of EarthWeb's

FREE IT newsletters at http://www.earthweb.com today!  

---

You are currently subscribed to asp_databases as: $subst('Recip.EmailAddr')

To unsubscribe send a blank email to leave-asp_databases-$subst('Recip.MemberIDChar')@p2p.wrox.com

Message #5 by "John P. Parlato" <jparlato@m...> on Wed, 13 Dec 2000 22:32:56 -0500
You said insert, but you code is update, you know there is a difference

don't you?



-----Original Message-----

From: Eric Van Camp [mailto:eric.vancamp@c...]

Sent: Wednesday, December 13, 2000 10:48 PM

To: ASP Databases

Subject: [asp_databases] Help !This one is getting me mad!





i use a sqlstring to insert into a table, written to the screen it looks

like:

UPDATE ENVELOPES set

envelopes.coyid='AMEEL',envelopes.envtypeid=,envelopes.size='',envelopes.win

dow='',envelopes.paper='',envelopes.flap='',envelopes.printcolors='',envelop

es.remarks='',envelopes.addressid=1,envelopes.tel='003216356999',envelopes.f

ax='',envelopes.btw='',envelopes.hr='',envelopes.b1='',envelopes.b2='',envel

opes.b3='',envelopes.b4='',envelopes.email='',envelopes.typeother='',envelop

es.actif=-1 where envelopes.envid=9

*********************

the original code is:

	strSQL="UPDATE BFORMS"&_

	" Set bforms.coyid='"& request.form("coyId") &

"',bforms.typeid='"&request.form("bformsid")&"',bforms.papertype='" &

request.form("typeid") & "', bforms.addressid="& request.form("addressid") &

", bforms.tel='" & strtel & "', bforms.fax='" & strfax & "', bforms.btw='"&

strbtw &"', bforms.hr='"& strhr & "' ,bforms.b1= '"& strb1 &"',bforms.b2='"&

strb2 &"' ,bforms.b3= '"& strb3 &"',bforms.b4='"& strb4 &"'

,bforms.description='"& request.form("description")&"' ,bforms.paper='"&

request.form("paper")&"' ,bforms.printcolors='"&

request.form("printcolors")&"' ,bforms.col1='"& request.form("col1")&"'

,bforms.col2= '"& request.form("col2")&"',bforms.col3= '"&

request.form("col3")&"',bforms.col4='"& request.form("col4")&"'

,bforms.col5='"&

request.form("col5")&"',bforms.actif="&stractif&",bforms.email='"&stremail&"

' where bforms.bformsid="&bformsid&""

*******************************



all varables which are not int are varchar and so there are some ''

inserted, that is all correct, although the error message i get is:

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'



[Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near

','.

so there is a comma somewhere that i missed???

can someone help me?







--- 

FREE SOFTWARE DEVELOPMENT CODE, CONTENT, AND

INSIGHTS IN YOUR INBOX!

Get the latest and best C++, Visual C++, Java, Visual Basic, and XML tips, tools, and 

developments from the experts.  Sign up for one or more of EarthWeb?s

FREE IT newsletters at http://www.earthweb.com today!  

---

You are currently subscribed to asp_databases as: $subst('Recip.EmailAddr')

To unsubscribe send a blank email to leave-asp_databases-$subst('Recip.MemberIDChar')@p2p.wrox.com


  Return to Index