Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access_asp thread: punctuation ?


Message #1 by tim.puffer@t... on Tue, 11 Feb 2003 15:19:57
i am trying to insert data in my access database via the following asp 
code.  when i use a single quote it fails (Diana's Best Pizza), i know its 
a matter of punctuation but i can't get it right. 

could someone help ?

Thanks in advance.

if NOT isempty(Request.Form("Update")) then
	rscn.Execute "update jobs set " _
	& "Cust_name = '" & Request.Form("cust_name") & "', " _
	& "end_user = '" & Request.Form("end_user") & "', " _
	& "equip = '" & Request.Form("equip") & "', " _
	& "ser_no = '" & Request.Form("ser_no") & "', " _
	& "id_dwg = '" & Request.Form("id_dwg") & "', " _
	& "rate = '" & Request.Form("rate") & "', " _
	& "pe = '" & Request.Form("pe") & "', " _
	& "product = '" & Request.Form("product") & "' where " _
	& "id = " & Request.Form("id")



<TR>
<TD width="150" align="left"><FONT SIZE="+1">Customer Name</FONT></TD>
<TD width="300">
<INPUT TYPE="text" NAME="cust_name" VALUE="<% response.write RSmanual
("cust_name") %>" size="50"></TD>
</TR>




Message #2 by "Charles Mabbott" <aa8vs@m...> on Tue, 11 Feb 2003 14:14:27 -0500
Use '' if I remember right, double it up and it should work
regards,
Chuck


"Whoever said the pen is mightier than the
sword obviously never encountered automatic
weapons."

http://68.43.100.7:81/aa8vs





>From: tim.puffer@t...
>Reply-To: "Access ASP" <access_asp@p...>
>To: "Access ASP" <access_asp@p...>
>Subject: [access_asp] punctuation ?
>Date: Tue, 11 Feb 2003 15:19:57
>
>i am trying to insert data in my access database via the following asp
>code.  when i use a single quote it fails (Diana's Best Pizza), i know its
>a matter of punctuation but i can't get it right.
>
>could someone help ?
>
>Thanks in advance.
>
>if NOT isempty(Request.Form("Update")) then
>	rscn.Execute "update jobs set " _
>	& "Cust_name = '" & Request.Form("cust_name") & "', " _
>	& "end_user = '" & Request.Form("end_user") & "', " _
>	& "equip = '" & Request.Form("equip") & "', " _
>	& "ser_no = '" & Request.Form("ser_no") & "', " _
>	& "id_dwg = '" & Request.Form("id_dwg") & "', " _
>	& "rate = '" & Request.Form("rate") & "', " _
>	& "pe = '" & Request.Form("pe") & "', " _
>	& "product = '" & Request.Form("product") & "' where " _
>	& "id = " & Request.Form("id")
>
>
>
><TR>
><TD width="150" align="left"><FONT SIZE="+1">Customer Name</FONT></TD>
><TD width="300">
><INPUT TYPE="text" NAME="cust_name" VALUE="<% response.write RSmanual
>("cust_name") %>" size="50"></TD>
></TR>
>
>
>
>


_________________________________________________________________
The new MSN 8: advanced junk mail protection and 2 months FREE*  
http://join.msn.com/?page=features/junkmail

Message #3 by "PUFFER, TIM" <tim.puffer@t...> on Tue, 11 Feb 2003 15:57:53 -0600
I tried your suggestion with no success. here is part of the error msg.

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in
query expression '''Diana's '', end_user = 'TimCo'.
/Jobs/update.asp, line 8

-----Original Message-----
From: Charles Mabbott [mailto:aa8vs@m...]
Sent: Tuesday, February 11, 2003 1:14 PM
To: Access ASP
Subject: [access_asp] Re: punctuation ?


Use '' if I remember right, double it up and it should work
regards,
Chuck


"Whoever said the pen is mightier than the
sword obviously never encountered automatic
weapons."

http://68.43.100.7:81/aa8vs





>From: tim.puffer@t...
>Reply-To: "Access ASP" <access_asp@p...>
>To: "Access ASP" <access_asp@p...>
>Subject: [access_asp] punctuation ?
>Date: Tue, 11 Feb 2003 15:19:57
>
>i am trying to insert data in my access database via the following asp
>code.  when i use a single quote it fails (Diana's Best Pizza), i know its
>a matter of punctuation but i can't get it right.
>
>could someone help ?
>
>Thanks in advance.
>
>if NOT isempty(Request.Form("Update")) then
>	rscn.Execute "update jobs set " _
>	& "Cust_name = '" & Request.Form("cust_name") & "', " _
>	& "end_user = '" & Request.Form("end_user") & "', " _
>	& "equip = '" & Request.Form("equip") & "', " _
>	& "ser_no = '" & Request.Form("ser_no") & "', " _
>	& "id_dwg = '" & Request.Form("id_dwg") & "', " _
>	& "rate = '" & Request.Form("rate") & "', " _
>	& "pe = '" & Request.Form("pe") & "', " _
>	& "product = '" & Request.Form("product") & "' where " _
>	& "id = " & Request.Form("id")
>
>
>
><TR>
><TD width="150" align="left"><FONT SIZE="+1">Customer Name</FONT></TD>
><TD width="300">
><INPUT TYPE="text" NAME="cust_name" VALUE="<% response.write RSmanual
>("cust_name") %>" size="50"></TD>
></TR>
>
>
>
>


_________________________________________________________________
The new MSN 8: advanced junk mail protection and 2 months FREE*  
http://join.msn.com/?page=features/junkmail


Message #4 by "Ken Schaefer" <ken@a...> on Wed, 12 Feb 2003 11:01:09 +1100
www.adopenstatic.com/faq/80040e14.asp
shows you which ' you should be doubling (not the delimiters, but the
literal ' you want to insert)

Cheers
Ken

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "PUFFER, TIM" <tim.puffer@t...>
Subject: [access_asp] Re: punctuation ?


: I tried your suggestion with no success. here is part of the error msg.
:
: Error Type:
: Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
: [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator)
in
: query expression '''Diana's '', end_user = 'TimCo'.
: /Jobs/update.asp, line 8
:
: -----Original Message-----
: From: Charles Mabbott [mailto:aa8vs@m...]
: Sent: Tuesday, February 11, 2003 1:14 PM
: To: Access ASP
: Subject: [access_asp] Re: punctuation ?
:
:
: Use '' if I remember right, double it up and it should work
: regards,
: Chuck
:
:
: "Whoever said the pen is mightier than the
: sword obviously never encountered automatic
: weapons."
:
: http://68.43.100.7:81/aa8vs
:
:
:
:
:
: >From: tim.puffer@t...
: >Reply-To: "Access ASP" <access_asp@p...>
: >To: "Access ASP" <access_asp@p...>
: >Subject: [access_asp] punctuation ?
: >Date: Tue, 11 Feb 2003 15:19:57
: >
: >i am trying to insert data in my access database via the following asp
: >code.  when i use a single quote it fails (Diana's Best Pizza), i know
its
: >a matter of punctuation but i can't get it right.
: >
: >could someone help ?
: >
: >Thanks in advance.
: >
: >if NOT isempty(Request.Form("Update")) then
: > rscn.Execute "update jobs set " _
: > & "Cust_name = '" & Request.Form("cust_name") & "', " _
: > & "end_user = '" & Request.Form("end_user") & "', " _
: > & "equip = '" & Request.Form("equip") & "', " _
: > & "ser_no = '" & Request.Form("ser_no") & "', " _
: > & "id_dwg = '" & Request.Form("id_dwg") & "', " _
: > & "rate = '" & Request.Form("rate") & "', " _
: > & "pe = '" & Request.Form("pe") & "', " _
: > & "product = '" & Request.Form("product") & "' where " _
: > & "id = " & Request.Form("id")

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Message #5 by "Charles Mabbott" <aa8vs@m...> on Tue, 11 Feb 2003 19:51:27 -0500
try 'Diana''s '  double it where you want the apostrophy to show up.....



"Whoever said the pen is mightier than the
sword obviously never encountered automatic
weapons."

http://68.43.100.7:81/aa8vs





>From: "PUFFER, TIM" <tim.puffer@t...>
>Reply-To: "Access ASP" <access_asp@p...>
>To: "Access ASP" <access_asp@p...>
>Subject: [access_asp] Re: punctuation ?
>Date: Tue, 11 Feb 2003 15:57:53 -0600
>
>I tried your suggestion with no success. here is part of the error msg.
>
>Error Type:
>Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
>[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) 
>in
>query expression '''Diana's '', end_user = 'TimCo'.
>/Jobs/update.asp, line 8
>
>-----Original Message-----
>From: Charles Mabbott [mailto:aa8vs@m...]
>Sent: Tuesday, February 11, 2003 1:14 PM
>To: Access ASP
>Subject: [access_asp] Re: punctuation ?
>
>
>Use '' if I remember right, double it up and it should work
>regards,
>Chuck
>
>
>"Whoever said the pen is mightier than the
>sword obviously never encountered automatic
>weapons."
>
>http://68.43.100.7:81/aa8vs
>
>
>
>
>
> >From: tim.puffer@t...
> >Reply-To: "Access ASP" <access_asp@p...>
> >To: "Access ASP" <access_asp@p...>
> >Subject: [access_asp] punctuation ?
> >Date: Tue, 11 Feb 2003 15:19:57
> >
> >i am trying to insert data in my access database via the following asp
> >code.  when i use a single quote it fails (Diana's Best Pizza), i know 
>its
> >a matter of punctuation but i can't get it right.
> >
> >could someone help ?
> >
> >Thanks in advance.
> >
> >if NOT isempty(Request.Form("Update")) then
> >	rscn.Execute "update jobs set " _
> >	& "Cust_name = '" & Request.Form("cust_name") & "', " _
> >	& "end_user = '" & Request.Form("end_user") & "', " _
> >	& "equip = '" & Request.Form("equip") & "', " _
> >	& "ser_no = '" & Request.Form("ser_no") & "', " _
> >	& "id_dwg = '" & Request.Form("id_dwg") & "', " _
> >	& "rate = '" & Request.Form("rate") & "', " _
> >	& "pe = '" & Request.Form("pe") & "', " _
> >	& "product = '" & Request.Form("product") & "' where " _
> >	& "id = " & Request.Form("id")
> >
> >
> >
> ><TR>
> ><TD width="150" align="left"><FONT SIZE="+1">Customer Name</FONT></TD>
> ><TD width="300">
> ><INPUT TYPE="text" NAME="cust_name" VALUE="<% response.write RSmanual
> >("cust_name") %>" size="50"></TD>
> ></TR>
> >
> >
> >
> >
>
>
>_________________________________________________________________
>The new MSN 8: advanced junk mail protection and 2 months FREE*
>http://join.msn.com/?page=features/junkmail
>
>
>


_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE*  
http://join.msn.com/?page=features/junkmail

Message #6 by "Leonid V" <vleonid@m...> on Tue, 11 Feb 2003 21:49:48 -0500
----------------------------------------------------------
Hi I dont know about the rest of the code but there is problem
This is yor code below:


if NOT isempty(Request.Form("Update")) then
	rscn.Execute "update jobs set " _
	& "Cust_name = '" & Request.Form("cust_name") & "', " _
	& "end_user = '"  & Request.Form("end_user")  & "', " _
	& "equip = '"     & Request.Form("equip")     & "', " _
	& "ser_no = '"    & Request.Form("ser_no")    & "', " _
	& "id_dwg = '"    & Request.Form("id_dwg")    & "', " _
	& "rate = '"      & Request.Form("rate")      & "', " _
	& "pe = '"        & Request.Form("pe")        & "', " _
	& "product = '"   & Request.Form("product")   & "' where " _
	& "id = "         & Request.Form("id")

Last lane should be:                  you forget to close it.
	& "id = '"         & Request.Form("id")       & "'"

----------------------------------------------------------


> >
> >i am trying to insert data in my access database via the following asp
> >code.  when i use a single quote it fails (Diana's Best Pizza), i know 
>its
> >a matter of punctuation but i can't get it right.
> >
> >could someone help ?
> >
> >Thanks in advance.
> >
> >if NOT isempty(Request.Form("Update")) then
> >	rscn.Execute "update jobs set " _
> >	& "Cust_name = '" & Request.Form("cust_name") & "', " _
> >	& "end_user = '" & Request.Form("end_user") & "', " _
> >	& "equip = '" & Request.Form("equip") & "', " _
> >	& "ser_no = '" & Request.Form("ser_no") & "', " _
> >	& "id_dwg = '" & Request.Form("id_dwg") & "', " _
> >	& "rate = '" & Request.Form("rate") & "', " _
> >	& "pe = '" & Request.Form("pe") & "', " _
> >	& "product = '" & Request.Form("product") & "' where " _
> >	& "id = " & Request.Form("id")
> >


_________________________________________________________________
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.  
http://join.msn.com/?page=features/virus

Message #7 by "Misconin, Michael" <Michael.Misconin@n...> on Wed, 12 Feb 2003 07:47:02 -0500
You can try using a sql statement to do the insert.

if NOT isempty(Request.Form("Update")) then
InsertSQL2 = "UPDATE Jobs SET Jobs.Cust_name = '" &
Request.Form("cust_name") & "', " & _
			" Jobs.end_user ='" & Request.Form("end_user") & "',
" & _
			" Jobs.equip ='" & Request.Form("equip") & "', " & _
			" Jobs.ser_no ='" & Request.Form("ser_no") & "', " &
_
" Jobs.ser_no ='" & Request.Form("ser_no") & "', " & _
			" Jobs.Resolution ='" & Resolution & _
			"' WHERE Jobs.ID = '" & ID & "'"
Set RS2 = objConnection.Execute (InsertSQL2)

-----Original Message-----
From: Leonid V [mailto:vleonid@m...]
Sent: Tuesday, February 11, 2003 9:50 PM
To: Access ASP
Subject: [access_asp] Re: punctuation ?


----------------------------------------------------------
Hi I dont know about the rest of the code but there is problem
This is yor code below:


if NOT isempty(Request.Form("Update")) then
	rscn.Execute "update jobs set " _
	& "Cust_name = '" & Request.Form("cust_name") & "', " _
	& "end_user = '"  & Request.Form("end_user")  & "', " _
	& "equip = '"     & Request.Form("equip")     & "', " _
	& "ser_no = '"    & Request.Form("ser_no")    & "', " _
	& "id_dwg = '"    & Request.Form("id_dwg")    & "', " _
	& "rate = '"      & Request.Form("rate")      & "', " _
	& "pe = '"        & Request.Form("pe")        & "', " _
	& "product = '"   & Request.Form("product")   & "' where " _
	& "id = "         & Request.Form("id")

Last lane should be:                  you forget to close it.
	& "id = '"         & Request.Form("id")       & "'"

----------------------------------------------------------


> >
> >i am trying to insert data in my access database via the following asp
> >code.  when i use a single quote it fails (Diana's Best Pizza), i know 
>its
> >a matter of punctuation but i can't get it right.
> >
> >could someone help ?
> >
> >Thanks in advance.
> >
> >if NOT isempty(Request.Form("Update")) then
> >	rscn.Execute "update jobs set " _
> >	& "Cust_name = '" & Request.Form("cust_name") & "', " _
> >	& "end_user = '" & Request.Form("end_user") & "', " _
> >	& "equip = '" & Request.Form("equip") & "', " _
> >	& "ser_no = '" & Request.Form("ser_no") & "', " _
> >	& "id_dwg = '" & Request.Form("id_dwg") & "', " _
> >	& "rate = '" & Request.Form("rate") & "', " _
> >	& "pe = '" & Request.Form("pe") & "', " _
> >	& "product = '" & Request.Form("product") & "' where " _
> >	& "id = " & Request.Form("id")
> >


_________________________________________________________________
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.  
http://join.msn.com/?page=features/virus




  Return to Index