Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: How to write an asp code to update data from the database ?


Message #1 by Lizawati Bakri <LIZA_B@e...> on Wed, 14 Feb 2001 11:18:15 +0800
This message is in MIME format. Since your mail reader does not understand

this format, some or all of this message may not be legible.



------_=_NextPart_001_01C09634.C7E99054

Content-Type: text/plain;

	charset="iso-8859-1"



I have a program to update data from database but I always receive an error

 because of the program...



I receive an error

 Microsoft VBScript compilation error '800a0409'

 Unterminated string constant

 /redesign/cgi-bin/intranet/liza/updatenotice.asp, line 26

sSQL =  "UPDATE notice SET notice.NoticeTitle='" & Request.form("title1")

"', notice.NoticeBody='" & Request.form("body1") & "', notice.ChangeBy='"

Request.form("changeby1") & "', notice.ChangeDate='"

Request.form("changedate1") & "' , notice.ChangeTime='"

Request.form("changetime1")  & "' WHERE (((notice.NoticeID)='"

Request.form("notice1") & "') AND ((notice.CategoryID)='"

Request.form("category1") & "') AND ((notice.CreatedBy)='"

Request.form("createby1") & "') AND ((notice.CreationDate)=#"

Request.form("createdate1") & "#)

 

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

------^



  so i have change it to :- first it without ("createdate1") & "#) then i

 change it to:- ("createdate1") & "#)"



 this is my program:



 Set DataConn = Server.CreateObject("ADODB.Connection")

DataConn.ConnectionTimeout = 15

DataConn.CommandTimeout = 30

DataConn.Open "DSN=CarCustomize"

Set cmdTemp = Server.CreateObject("ADODB.Command")

Set rstemp = Server.CreateObject("ADODB.Recordset")

Dim sSQL

sSQL =  "UPDATE notice SET notice.NoticeTitle='" & Request.form("title1") &

"', notice.NoticeBody='" & Request.form("body1") & "', notice.ChangeBy='" &

Request.form("changeby1") & "', notice.ChangeDate='" &

Request.form("changedate1") & "' , notice.ChangeTime='" &

Request.form("changetime1")  & "' WHERE (((notice.NoticeID)='" &

Request.form("notice1") & "') AND ((notice.CategoryID)='" &

Request.form("category1") & "') AND ((notice.CreatedBy)='" &

Request.form("createby1") & "') AND ((notice.CreationDate)=#" &

Request.form("createdate1") & "#)" AND ((notice.CreationTime)='" &

Request.form("createtime1") & "'))"

Response.Write(sSQL)

cmdTemp.CommandText = sSQL

Set cmdTemp.ActiveConnection = DataConn

rstemp.Open cmdTemp, , adOpenKeyset, adLockOptimistic    





Is my syntax of the program is correct ? If not please write the correct

one..
















Message #2 by Gregory_Griffiths@c... on Wed, 14 Feb 2001 08:54:49 +0000
Please send us the results of the print line :



Response.Write(sSQL)



I think that this could reveal the cause of your problem.



> -----Original Message-----

> From: LIZA_B@e... [mailto:LIZA_B@e...]

> Sent: 14 February 2001 14:47

> To: asp_databases@p...

> Cc: LIZA_B@e...

> Subject: [asp_databases] How to write an asp code to update data from

> the database ?

> 

> 

> This message is in MIME format. Since your mail reader does 

> not understand

> this format, some or all of this message may not be legible.

> 

> ------_=_NextPart_001_01C09634.C7E99054

> Content-Type: text/plain;

> 	charset="iso-8859-1"

> 

> I have a program to update data from database but I always 

> receive an error

>  because of the program...

> 

> I receive an error

>  Microsoft VBScript compilation error '800a0409'

>  Unterminated string constant

>  /redesign/cgi-bin/intranet/liza/updatenotice.asp, line 26

> sSQL =  "UPDATE notice SET notice.NoticeTitle='" & 

> Request.form("title1")

> "', notice.NoticeBody='" & Request.form("body1") & "', 

> notice.ChangeBy='"

> Request.form("changeby1") & "', notice.ChangeDate='"

> Request.form("changedate1") & "' , notice.ChangeTime='"

> Request.form("changetime1")  & "' WHERE (((notice.NoticeID)='"

> Request.form("notice1") & "') AND ((notice.CategoryID)='"

> Request.form("category1") & "') AND ((notice.CreatedBy)='"

> Request.form("createby1") & "') AND ((notice.CreationDate)=#"

> Request.form("createdate1") & "#)

>  

> --------------------------------------------------------------

> --------------

> ------^

> 

>   so i have change it to :- first it without ("createdate1") 

> & "#) then i

>  change it to:- ("createdate1") & "#)"

> 

>  this is my program:

> 

>  Set DataConn = Server.CreateObject("ADODB.Connection")

> DataConn.ConnectionTimeout = 15

> DataConn.CommandTimeout = 30

> DataConn.Open "DSN=CarCustomize"

> Set cmdTemp = Server.CreateObject("ADODB.Command")

> Set rstemp = Server.CreateObject("ADODB.Recordset")

> Dim sSQL

> sSQL =  "UPDATE notice SET notice.NoticeTitle='" & 

> Request.form("title1") &

> "', notice.NoticeBody='" & Request.form("body1") & "', 

> notice.ChangeBy='" &

> Request.form("changeby1") & "', notice.ChangeDate='" &

> Request.form("changedate1") & "' , notice.ChangeTime='" &

> Request.form("changetime1")  & "' WHERE (((notice.NoticeID)='" &

> Request.form("notice1") & "') AND ((notice.CategoryID)='" &

> Request.form("category1") & "') AND ((notice.CreatedBy)='" &

> Request.form("createby1") & "') AND ((notice.CreationDate)=#" &

> Request.form("createdate1") & "#)" AND ((notice.CreationTime)='" &

> Request.form("createtime1") & "'))"

> Response.Write(sSQL)

> cmdTemp.CommandText = sSQL

> Set cmdTemp.ActiveConnection = DataConn

> rstemp.Open cmdTemp, , adOpenKeyset, adLockOptimistic    

> 

> 

> Is my syntax of the program is correct ? If not please write 

> the correct

> one..

> 

> 

> 

> 

> 

> 

> 

> ------_=_NextPart_001_01C09634.C7E99054

> Content-Type: text/html;

> 	charset="iso-8859-1"

> Content-Transfer-Encoding: quoted-printable

> 

> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">

> <HTML>

> <HEAD>

> <META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; 

> charset=3Diso-8859-1">

> <META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version 

> 5.5.2650.12">

> <TITLE>How to write an asp code to update data from the database 

> ?</TITLE>

> </HEAD>

> <BODY>

> 

> <P><FONT SIZE=3D2 FACE=3D"Courier New">I have a program to 

> update data 

> from database but I always receive an error</FONT>

> <BR><FONT SIZE=3D2 FACE=3D"Courier New"> because of the 

> program...</FONT>

> </P>

> 

> <P><FONT SIZE=3D2 FACE=3D"Courier New">I receive an error</FONT>

> <BR><FONT SIZE=3D2 FACE=3D"Courier New"> Microsoft VBScript 

> compilation error '800a0409'</FONT>

> <BR><FONT SIZE=3D2 FACE=3D"Courier New"> Unterminated string 

> constant</FONT>

> <BR><FONT SIZE=3D2 FACE=3D"Courier 

> New"> /redesign/cgi-bin/intranet/liza/updatenotice.asp, line 

> 26</FONT>

> <BR><FONT SIZE=3D2 FACE=3D"Courier New">sSQL =3D  "UPDATE 

> notice SET notice.NoticeTitle=3D'" & 

> Request.form("title1")  "', 

> notice.NoticeBody=3D'" & 

> Request.form("body1") & 

> "', notice.ChangeBy=3D'"  

> Request.form("changeby1") & "', 

> notice.ChangeDate=3D'"  

> Request.form("changedate1") 

> & "' , notice.ChangeTime=3D'"  

> Request.form("changetime1")  & "' WHERE 

> (((notice.NoticeID)=3D'"  

> Request.form("notice1") 

> & "') AND ((notice.CategoryID)=3D'"  

> Request.form("category1") & "') AND 

> ((notice.CreatedBy)=3D'"  

> Request.form("createby1") 

> & "') AND ((notice.CreationDate)=3D#"  

> Request.form("createdate1") & "#)</FONT></P>

> 

> <P><FONT SIZE=3D2 FACE=3D"Courier 

> New"> ---------------------------------------------------

> ----------

> ---------------------^</FONT>

> </P>

> 

> <P><FONT SIZE=3D2 FACE=3D"Courier New">  so i have 

> change it to :- 

> first it without ("createdate1") & "#) 

> then i</FONT>

> <BR><FONT SIZE=3D2 FACE=3D"Courier New"> change it to:- 

> ("createdate1") & "#)"</FONT>

> </P>

> 

> <P><FONT SIZE=3D2 FACE=3D"Courier New"> this is my 

> program:</FONT>

> </P>

> 

> <P><FONT SIZE=3D2 FACE=3D"Courier New"></FONT> <FONT 

> COLOR=3D"#800000" SIZE=3D2 FACE=3D"Courier New">Set DataConn =3D 

> Server.CreateObject("ADODB.Connection")</FONT>

> <BR><FONT COLOR=3D"#800000" SIZE=3D2 FACE=3D"Courier 

> New">DataConn.ConnectionTimeout =3D 15</FONT>

> <BR><FONT COLOR=3D"#800000" SIZE=3D2 FACE=3D"Courier 

> New">DataConn.CommandTimeout =3D 30</FONT>

> <BR><FONT COLOR=3D"#800000" SIZE=3D2 FACE=3D"Courier 

> New">DataConn.Open 

> "DSN=3DCarCustomize"</FONT>

> <BR><FONT COLOR=3D"#800000" SIZE=3D2 FACE=3D"Courier New">Set 

> cmdTemp 

> =3D Server.CreateObject("ADODB.Command")</FONT>

> <BR><FONT COLOR=3D"#800000" SIZE=3D2 FACE=3D"Courier New">Set rstemp 

> =3D Server.CreateObject("ADODB.Recordset")</FONT>

> <BR><FONT COLOR=3D"#800000" SIZE=3D2 FACE=3D"Courier New">Dim 

> sSQL</FONT>

> <BR><FONT COLOR=3D"#800000" SIZE=3D2 FACE=3D"Courier New">sSQL 

> =3D  "UPDATE notice SET notice.NoticeTitle=3D'" & 

> Request.form("title1") & "', 

> notice.NoticeBody=3D'" & 

> Request.form("body1") & 

> "', notice.ChangeBy=3D'" & 

> Request.form("changeby1") & "', 

> notice.ChangeDate=3D'" & 

> Request.form("changedate1") 

> & "' , notice.ChangeTime=3D'" & 

> Request.form("changetime1")  & "' WHERE 

> (((notice.NoticeID)=3D'" & 

> Request.form("notice1") 

> & "') AND ((notice.CategoryID)=3D'" & 

> Request.form("category1") & "') AND 

> ((notice.CreatedBy)=3D'" & 

> Request.form("createby1") 

> & "') AND ((notice.CreationDate)=3D#" & 

> Request.form("createdate1") & "#)" AND 

> ((notice.CreationTime)=3D'" & 

> Request.form("createtime1") & "'))"</FONT></P>

> 

> <P><FONT COLOR=3D"#800000" SIZE=3D2 FACE=3D"Courier 

> New">Response.Write(sSQL)</FONT>

> <BR><FONT COLOR=3D"#800000" SIZE=3D2 FACE=3D"Courier 

> New">cmdTemp.CommandText =3D sSQL</FONT>

> <BR><FONT COLOR=3D"#800000" SIZE=3D2 FACE=3D"Courier New">Set 

> cmdTemp.ActiveConnection =3D DataConn</FONT>

> <BR><FONT COLOR=3D"#800000" SIZE=3D2 FACE=3D"Courier 

> New">rstemp.Open 

> cmdTemp, , adOpenKeyset, adLockOptimistic    </FONT>

> </P>

> <BR>

> 

> <P><B><FONT COLOR=3D"#FF0000" SIZE=3D2 FACE=3D"Courier New">Is my 

> syntax of the program is correct ? If not please write the correct 

> one..</FONT></B>

> </P>

> <BR>

> <BR>

> <BR>

> <BR>

> <BR>

> 

> 

> ---<BR>

> FREE WEB DEVELOPMENT CODE, CONTENT, AND INSIGHTS<BR>

> IN YOUR INBOX!<BR>

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

> tools, and <BR>

> developments from the experts.  Sign up for one or more of 

> EarthWeb's<BR>

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

> ---<BR>


> gregory_griffiths@c...<BR>


> $subst('Email.Unsub')<BR>

> 

> </BODY>

> </HTML>

> ------_=_NextPart_001_01C09634.C7E99054--

> 

> 



Message #3 by mrucker@m... on Wed, 14 Feb 2001 15:38:22
<<sSQL =  "UPDATE notice SET notice.NoticeTitle='" & Request.form("title1")

"', notice.NoticeBody='" & Request.form("body1") & "', notice.ChangeBy='"



etc. etc. >>





Looks like maybe a missing ampersand "&"? Should be?



sSQL =  "UPDATE notice SET notice.NoticeTitle='" & Request.form("title1")

& "', notice.NoticeBody='" & Request.form("body1") & "', notice.ChangeBy='"



Other suggestion on using Response.Write sSQL is a mandatory technique for 

me cause I never get it right in the first go.
Message #4 by Lizawati Bakri <LIZA_B@e...> on Thu, 15 Feb 2001 08:59:24 +0800
This message is in MIME format. Since your mail reader does not understand

this format, some or all of this message may not be legible.



------_=_NextPart_001_01C096EA.8BEFA168

Content-Type: text/plain;

	charset="iso-8859-1"



What do you mean by send the result of the print line..?



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

From: Gregory_Griffiths@c...

[mailto:Gregory_Griffiths@c...]

Sent: Wednesday, February 14, 2001 4:55 PM

To: ASP Databases

Subject: [asp_databases] RE: How to write an asp code to update data

from the database ?





Please send us the results of the print line :



Response.Write(sSQL)



I think that this could reveal the cause of your problem.



> -----Original Message-----

> From: LIZA_B@e... [mailto:LIZA_B@e...]

> Sent: 14 February 2001 14:47

> To: asp_databases@p...

> Cc: LIZA_B@e...

> Subject: [asp_databases] How to write an asp code to update data from

> the database ?

> 

> 

> This message is in MIME format. Since your mail reader does 

> not understand

> this format, some or all of this message may not be legible.

> 

> ------_=_NextPart_001_01C09634.C7E99054

> Content-Type: text/plain;

> 	charset="iso-8859-1"

> 

> I have a program to update data from database but I always 

> receive an error

>  because of the program...

> 

> I receive an error

>  Microsoft VBScript compilation error '800a0409'

>  Unterminated string constant

>  /redesign/cgi-bin/intranet/liza/updatenotice.asp, line 26

> sSQL =  "UPDATE notice SET notice.NoticeTitle='" & 

> Request.form("title1")

> "', notice.NoticeBody='" & Request.form("body1") & "', 

> notice.ChangeBy='"

> Request.form("changeby1") & "', notice.ChangeDate='"

> Request.form("changedate1") & "' , notice.ChangeTime='"

> Request.form("changetime1")  & "' WHERE (((notice.NoticeID)='"

> Request.form("notice1") & "') AND ((notice.CategoryID)='"

> Request.form("category1") & "') AND ((notice.CreatedBy)='"

> Request.form("createby1") & "') AND ((notice.CreationDate)=#"

> Request.form("createdate1") & "#)

>  

> --------------------------------------------------------------

> --------------

> ------^

> 

>   so i have change it to :- first it without ("createdate1") 

> & "#) then i

>  change it to:- ("createdate1") & "#)"

> 

>  this is my program:

> 

>  Set DataConn = Server.CreateObject("ADODB.Connection")

> DataConn.ConnectionTimeout = 15

> DataConn.CommandTimeout = 30

> DataConn.Open "DSN=CarCustomize"

> Set cmdTemp = Server.CreateObject("ADODB.Command")

> Set rstemp = Server.CreateObject("ADODB.Recordset")

> Dim sSQL

> sSQL =  "UPDATE notice SET notice.NoticeTitle='" & 

> Request.form("title1") &

> "', notice.NoticeBody='" & Request.form("body1") & "', 

> notice.ChangeBy='" &

> Request.form("changeby1") & "', notice.ChangeDate='" &

> Request.form("changedate1") & "' , notice.ChangeTime='" &

> Request.form("changetime1")  & "' WHERE (((notice.NoticeID)='" &

> Request.form("notice1") & "') AND ((notice.CategoryID)='" &

> Request.form("category1") & "') AND ((notice.CreatedBy)='" &

> Request.form("createby1") & "') AND ((notice.CreationDate)=#" &

> Request.form("createdate1") & "#)" AND ((notice.CreationTime)='" &

> Request.form("createtime1") & "'))"

> Response.Write(sSQL)

> cmdTemp.CommandText = sSQL

> Set cmdTemp.ActiveConnection = DataConn

> rstemp.Open cmdTemp, , adOpenKeyset, adLockOptimistic    

> 

> 

> Is my syntax of the program is correct ? If not please write 

> the correct

> one..

> 

> 

> 

> 

> 

> 

> 

> ------_=_NextPart_001_01C09634.C7E99054

> Content-Type: text/html;

> 	charset="iso-8859-1"

> Content-Transfer-Encoding: quoted-printable

> 

> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">

> <HTML>

> <HEAD>

> <META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; 

> charset=3Diso-8859-1">

> <META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version 

> 5.5.2650.12">

> <TITLE>How to write an asp code to update data from the database 

> ?</TITLE>

> </HEAD>

> <BODY>

> 

> <P><FONT SIZE=3D2 FACE=3D"Courier New">I have a program to 

> update data 

> from database but I always receive an error</FONT>

> <BR><FONT SIZE=3D2 FACE=3D"Courier New"> because of the 

> program...</FONT>

> </P>

> 

> <P><FONT SIZE=3D2 FACE=3D"Courier New">I receive an error</FONT>

> <BR><FONT SIZE=3D2 FACE=3D"Courier New"> Microsoft VBScript 

> compilation error '800a0409'</FONT>

> <BR><FONT SIZE=3D2 FACE=3D"Courier New"> Unterminated string 

> constant</FONT>

> <BR><FONT SIZE=3D2 FACE=3D"Courier 

> New"> /redesign/cgi-bin/intranet/liza/updatenotice.asp, line 

> 26</FONT>

> <BR><FONT SIZE=3D2 FACE=3D"Courier New">sSQL =3D  "UPDATE 

> notice SET notice.NoticeTitle=3D'" & 

> Request.form("title1")  "', 

> notice.NoticeBody=3D'" & 

> Request.form("body1") & 

> "', notice.ChangeBy=3D'"  

> Request.form("changeby1") & "', 

> notice.ChangeDate=3D'"  

> Request.form("changedate1") 

> & "' , notice.ChangeTime=3D'"  

> Request.form("changetime1")  & "' WHERE 

> (((notice.NoticeID)=3D'"  

> Request.form("notice1") 

> & "') AND ((notice.CategoryID)=3D'"  

> Request.form("category1") & "') AND 

> ((notice.CreatedBy)=3D'"  

> Request.form("createby1") 

> & "') AND ((notice.CreationDate)=3D#"  

> Request.form("createdate1") & "#)</FONT></P>

> 

> <P><FONT SIZE=3D2 FACE=3D"Courier 

> New"> ---------------------------------------------------

> ----------

> ---------------------^</FONT>

> </P>

> 

> <P><FONT SIZE=3D2 FACE=3D"Courier New">  so i have 

> change it to :- 

> first it without ("createdate1") & "#) 

> then i</FONT>

> <BR><FONT SIZE=3D2 FACE=3D"Courier New"> change it to:- 

> ("createdate1") & "#)"</FONT>

> </P>

> 

> <P><FONT SIZE=3D2 FACE=3D"Courier New"> this is my 

> program:</FONT>

> </P>

> 

> <P><FONT SIZE=3D2 FACE=3D"Courier New"></FONT> <FONT 

> COLOR=3D"#800000" SIZE=3D2 FACE=3D"Courier New">Set DataConn =3D 

> Server.CreateObject("ADODB.Connection")</FONT>

> <BR><FONT COLOR=3D"#800000" SIZE=3D2 FACE=3D"Courier 

> New">DataConn.ConnectionTimeout =3D 15</FONT>

> <BR><FONT COLOR=3D"#800000" SIZE=3D2 FACE=3D"Courier 

> New">DataConn.CommandTimeout =3D 30</FONT>

> <BR><FONT COLOR=3D"#800000" SIZE=3D2 FACE=3D"Courier 

> New">DataConn.Open 

> "DSN=3DCarCustomize"</FONT>

> <BR><FONT COLOR=3D"#800000" SIZE=3D2 FACE=3D"Courier New">Set 

> cmdTemp 

> =3D Server.CreateObject("ADODB.Command")</FONT>

> <BR><FONT COLOR=3D"#800000" SIZE=3D2 FACE=3D"Courier New">Set rstemp 

> =3D Server.CreateObject("ADODB.Recordset")</FONT>

> <BR><FONT COLOR=3D"#800000" SIZE=3D2 FACE=3D"Courier New">Dim 

> sSQL</FONT>

> <BR><FONT COLOR=3D"#800000" SIZE=3D2 FACE=3D"Courier New">sSQL 

> =3D  "UPDATE notice SET notice.NoticeTitle=3D'" & 

> Request.form("title1") & "', 

> notice.NoticeBody=3D'" & 

> Request.form("body1") & 

> "', notice.ChangeBy=3D'" & 

> Request.form("changeby1") & "', 

> notice.ChangeDate=3D'" & 

> Request.form("changedate1") 

> & "' , notice.ChangeTime=3D'" & 

> Request.form("changetime1")  & "' WHERE 

> (((notice.NoticeID)=3D'" & 

> Request.form("notice1") 

> & "') AND ((notice.CategoryID)=3D'" & 

> Request.form("category1") & "') AND 

> ((notice.CreatedBy)=3D'" & 

> Request.form("createby1") 

> & "') AND ((notice.CreationDate)=3D#" & 

> Request.form("createdate1") & "#)" AND 

> ((notice.CreationTime)=3D'" & 

> Request.form("createtime1") & "'))"</FONT></P>

> 

> <P><FONT COLOR=3D"#800000" SIZE=3D2 FACE=3D"Courier 

> New">Response.Write(sSQL)</FONT>

> <BR><FONT COLOR=3D"#800000" SIZE=3D2 FACE=3D"Courier 

> New">cmdTemp.CommandText =3D sSQL</FONT>

> <BR><FONT COLOR=3D"#800000" SIZE=3D2 FACE=3D"Courier New">Set 

> cmdTemp.ActiveConnection =3D DataConn</FONT>

> <BR><FONT COLOR=3D"#800000" SIZE=3D2 FACE=3D"Courier 

> New">rstemp.Open 

> cmdTemp, , adOpenKeyset, adLockOptimistic    </FONT>

> </P>

> <BR>

> 

> <P><B><FONT COLOR=3D"#FF0000" SIZE=3D2 FACE=3D"Courier New">Is my 

> syntax of the program is correct ? If not please write the correct 

> one..</FONT></B>

> </P>

> <BR>

> <BR>

> <BR>

> <BR>

> <BR>

> 

> 

> ---<BR>

> FREE WEB DEVELOPMENT CODE, CONTENT, AND INSIGHTS<BR>

> IN YOUR INBOX!<BR>

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

> tools, and <BR>

> developments from the experts.  Sign up for one or more of 

> EarthWeb's<BR>

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

> ---<BR>


> gregory_griffiths@c...<BR>


> $subst('Email.Unsub')<BR>

> 

> 

---<BR>

You are currently subscribed to asp_databases as: LIZA_B@e...<BR>


$subst('Email.Unsub')<BR>



</BODY>

> </HTML>

> ------_=_NextPart_001_01C09634.C7E99054--

> 

> 






Message #5 by Lizawati Bakri <LIZA_B@e...> on Thu, 15 Feb 2001 09:22:04 +0800
This message is in MIME format. Since your mail reader does not understand

this format, some or all of this message may not be legible.



------_=_NextPart_001_01C096ED.B6FA733A

Content-Type: text/plain;

	charset="iso-8859-1"



It should be update the notice title ,notice body,and who change the notice

...



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

From: Gregory_Griffiths@c...

[mailto:Gregory_Griffiths@c...]

Sent: Wednesday, February 14, 2001 4:55 PM

To: ASP Databases

Subject: [asp_databases] RE: How to write an asp code to update data

from the database ?





Please send us the results of the print line :



Response.Write(sSQL)



I think that this could reveal the cause of your problem.



> -----Original Message-----

> From: LIZA_B@e... [mailto:LIZA_B@e...]

> Sent: 14 February 2001 14:47

> To: asp_databases@p...

> Cc: LIZA_B@e...

> Subject: [asp_databases] How to write an asp code to update data from

> the database ?

> 

> 

> This message is in MIME format. Since your mail reader does 

> not understand

> this format, some or all of this message may not be legible.

> 

> ------_=_NextPart_001_01C09634.C7E99054

> Content-Type: text/plain;

> 	charset="iso-8859-1"

> 

> I have a program to update data from database but I always 

> receive an error

>  because of the program...

> 

> I receive an error

>  Microsoft VBScript compilation error '800a0409'

>  Unterminated string constant

>  /redesign/cgi-bin/intranet/liza/updatenotice.asp, line 26

> sSQL =  "UPDATE notice SET notice.NoticeTitle='" & 

> Request.form("title1")

> "', notice.NoticeBody='" & Request.form("body1") & "', 

> notice.ChangeBy='"

> Request.form("changeby1") & "', notice.ChangeDate='"

> Request.form("changedate1") & "' , notice.ChangeTime='"

> Request.form("changetime1")  & "' WHERE (((notice.NoticeID)='"

> Request.form("notice1") & "') AND ((notice.CategoryID)='"

> Request.form("category1") & "') AND ((notice.CreatedBy)='"

> Request.form("createby1") & "') AND ((notice.CreationDate)=#"

> Request.form("createdate1") & "#)

>  

> --------------------------------------------------------------

> --------------

> ------^

> 

>   so i have change it to :- first it without ("createdate1") 

> & "#) then i

>  change it to:- ("createdate1") & "#)"

> 

>  this is my program:

> 

>  Set DataConn = Server.CreateObject("ADODB.Connection")

> DataConn.ConnectionTimeout = 15

> DataConn.CommandTimeout = 30

> DataConn.Open "DSN=CarCustomize"

> Set cmdTemp = Server.CreateObject("ADODB.Command")

> Set rstemp = Server.CreateObject("ADODB.Recordset")

> Dim sSQL

> sSQL =  "UPDATE notice SET notice.NoticeTitle='" & 

> Request.form("title1") &

> "', notice.NoticeBody='" & Request.form("body1") & "', 

> notice.ChangeBy='" &

> Request.form("changeby1") & "', notice.ChangeDate='" &

> Request.form("changedate1") & "' , notice.ChangeTime='" &

> Request.form("changetime1")  & "' WHERE (((notice.NoticeID)='" &

> Request.form("notice1") & "') AND ((notice.CategoryID)='" &

> Request.form("category1") & "') AND ((notice.CreatedBy)='" &

> Request.form("createby1") & "') AND ((notice.CreationDate)=#" &

> Request.form("createdate1") & "#)" AND ((notice.CreationTime)='" &

> Request.form("createtime1") & "'))"

> Response.Write(sSQL)

> cmdTemp.CommandText = sSQL

> Set cmdTemp.ActiveConnection = DataConn

> rstemp.Open cmdTemp, , adOpenKeyset, adLockOptimistic    

> 

> 

> Is my syntax of the program is correct ? If not please write 

> the correct

> one..

> 

> 

> 

> 

> 

> 

> 

> ------_=_NextPart_001_01C09634.C7E99054

> Content-Type: text/html;

> 	charset="iso-8859-1"

> Content-Transfer-Encoding: quoted-printable

> 

> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">

> <HTML>

> <HEAD>

> <META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; 

> charset=3Diso-8859-1">

> <META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version 

> 5.5.2650.12">

> <TITLE>How to write an asp code to update data from the database 

> ?</TITLE>

> </HEAD>

> <BODY>

> 

> <P><FONT SIZE=3D2 FACE=3D"Courier New">I have a program to 

> update data 

> from database but I always receive an error</FONT>

> <BR><FONT SIZE=3D2 FACE=3D"Courier New"> because of the 

> program...</FONT>

> </P>

> 

> <P><FONT SIZE=3D2 FACE=3D"Courier New">I receive an error</FONT>

> <BR><FONT SIZE=3D2 FACE=3D"Courier New"> Microsoft VBScript 

> compilation error '800a0409'</FONT>

> <BR><FONT SIZE=3D2 FACE=3D"Courier New"> Unterminated string 

> constant</FONT>

> <BR><FONT SIZE=3D2 FACE=3D"Courier 

> New"> /redesign/cgi-bin/intranet/liza/updatenotice.asp, line 

> 26</FONT>

> <BR><FONT SIZE=3D2 FACE=3D"Courier New">sSQL =3D  "UPDATE 

> notice SET notice.NoticeTitle=3D'" & 

> Request.form("title1")  "', 

> notice.NoticeBody=3D'" & 

> Request.form("body1") & 

> "', notice.ChangeBy=3D'"  

> Request.form("changeby1") & "', 

> notice.ChangeDate=3D'"  

> Request.form("changedate1") 

> & "' , notice.ChangeTime=3D'"  

> Request.form("changetime1")  & "' WHERE 

> (((notice.NoticeID)=3D'"  

> Request.form("notice1") 

> & "') AND ((notice.CategoryID)=3D'"  

> Request.form("category1") & "') AND 

> ((notice.CreatedBy)=3D'"  

> Request.form("createby1") 

> & "') AND ((notice.CreationDate)=3D#"  

> Request.form("createdate1") & "#)</FONT></P>

> 

> <P><FONT SIZE=3D2 FACE=3D"Courier 

> New"> ---------------------------------------------------

> ----------

> ---------------------^</FONT>

> </P>

> 

> <P><FONT SIZE=3D2 FACE=3D"Courier New">  so i have 

> change it to :- 

> first it without ("createdate1") & "#) 

> then i</FONT>

> <BR><FONT SIZE=3D2 FACE=3D"Courier New"> change it to:- 

> ("createdate1") & "#)"</FONT>

> </P>

> 

> <P><FONT SIZE=3D2 FACE=3D"Courier New"> this is my 

> program:</FONT>

> </P>

> 

> <P><FONT SIZE=3D2 FACE=3D"Courier New"></FONT> <FONT 

> COLOR=3D"#800000" SIZE=3D2 FACE=3D"Courier New">Set DataConn =3D 

> Server.CreateObject("ADODB.Connection")</FONT>

> <BR><FONT COLOR=3D"#800000" SIZE=3D2 FACE=3D"Courier 

> New">DataConn.ConnectionTimeout =3D 15</FONT>

> <BR><FONT COLOR=3D"#800000" SIZE=3D2 FACE=3D"Courier 

> New">DataConn.CommandTimeout =3D 30</FONT>

> <BR><FONT COLOR=3D"#800000" SIZE=3D2 FACE=3D"Courier 

> New">DataConn.Open 

> "DSN=3DCarCustomize"</FONT>

> <BR><FONT COLOR=3D"#800000" SIZE=3D2 FACE=3D"Courier New">Set 

> cmdTemp 

> =3D Server.CreateObject("ADODB.Command")</FONT>

> <BR><FONT COLOR=3D"#800000" SIZE=3D2 FACE=3D"Courier New">Set rstemp 

> =3D Server.CreateObject("ADODB.Recordset")</FONT>

> <BR><FONT COLOR=3D"#800000" SIZE=3D2 FACE=3D"Courier New">Dim 

> sSQL</FONT>

> <BR><FONT COLOR=3D"#800000" SIZE=3D2 FACE=3D"Courier New">sSQL 

> =3D  "UPDATE notice SET notice.NoticeTitle=3D'" & 

> Request.form("title1") & "', 

> notice.NoticeBody=3D'" & 

> Request.form("body1") & 

> "', notice.ChangeBy=3D'" & 

> Request.form("changeby1") & "', 

> notice.ChangeDate=3D'" & 

> Request.form("changedate1") 

> & "' , notice.ChangeTime=3D'" & 

> Request.form("changetime1")  & "' WHERE 

> (((notice.NoticeID)=3D'" & 

> Request.form("notice1") 

> & "') AND ((notice.CategoryID)=3D'" & 

> Request.form("category1") & "') AND 

> ((notice.CreatedBy)=3D'" & 

> Request.form("createby1") 

> & "') AND ((notice.CreationDate)=3D#" & 

> Request.form("createdate1") & "#)" AND 

> ((notice.CreationTime)=3D'" & 

> Request.form("createtime1") & "'))"</FONT></P>

> 

> <P><FONT COLOR=3D"#800000" SIZE=3D2 FACE=3D"Courier 

> New">Response.Write(sSQL)</FONT>

> <BR><FONT COLOR=3D"#800000" SIZE=3D2 FACE=3D"Courier 

> New">cmdTemp.CommandText =3D sSQL</FONT>

> <BR><FONT COLOR=3D"#800000" SIZE=3D2 FACE=3D"Courier New">Set 

> cmdTemp.ActiveConnection =3D DataConn</FONT>

> <BR><FONT COLOR=3D"#800000" SIZE=3D2 FACE=3D"Courier 

> New">rstemp.Open 

> cmdTemp, , adOpenKeyset, adLockOptimistic    </FONT>

> </P>

> <BR>

> 

> <P><B><FONT COLOR=3D"#FF0000" SIZE=3D2 FACE=3D"Courier New">Is my 

> syntax of the program is correct ? If not please write the correct 

> one..</FONT></B>

> </P>

> <BR>

> <BR>

> <BR>

> <BR>

> <BR>

> 

> 

> ---<BR>

> FREE WEB DEVELOPMENT CODE, CONTENT, AND INSIGHTS<BR>

> IN YOUR INBOX!<BR>

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

> tools, and <BR>

> developments from the experts.  Sign up for one or more of 

> EarthWeb's<BR>

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

> ---<BR>


> gregory_griffiths@c...<BR>


> $subst('Email.Unsub')<BR>

> 

> 

---<BR>

You are currently subscribed to asp_databases as: LIZA_B@e...<BR>


$subst('Email.Unsub')<BR>



</BODY>

> </HTML>

> ------_=_NextPart_001_01C09634.C7E99054--

> 

> 






Message #6 by "Ken Schaefer" <ken@a...> on Thu, 15 Feb 2001 17:37:19 +1100
It means:



Response.Write() your SQL string to the screen. Cut and paste the output

into and email message and send it to the list.



Cheers

Ken



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

From: "Lizawati Bakri" <LIZA_B@e...>

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

Sent: Thursday, February 15, 2001 11:59 AM

Subject: [asp_databases] RE: How to write an asp code to update data f rom

the database ?





> What do you mean by send the result of the print line..?

>

> -----Original Message-----

> From: Gregory_Griffiths@c...

> [mailto:Gregory_Griffiths@c...]

> Sent: Wednesday, February 14, 2001 4:55 PM

> To: ASP Databases

> Subject: [asp_databases] RE: How to write an asp code to update data

> from the database ?

>

>

> Please send us the results of the print line :

>

> Response.Write(sSQL)

>

> I think that this could reveal the cause of your problem.

>





Message #7 by Lizawati Bakri <LIZA_B@e...> on Thu, 15 Feb 2001 14:44:22 +0800
This message is in MIME format. Since your mail reader does not understand

this format, some or all of this message may not be legible.



------_=_NextPart_001_01C0971A.BAD6805C

Content-Type: text/plain;

	charset="iso-8859-1"



Like this :



Microsoft VBScript compilation error '800a03ea' 



Syntax error 



/redesign/cgi-bin/intranet/liza/updatenotice.asp, line 26 



sSQL =  "UPDATE notice SET notice.NoticeTitle='" & Request.form("title1") &

"', notice.NoticeBody='" & Request.form("body1") & "', notice.ChangeBy='" &

Request.form("changeby1") & "', notice.ChangeDate='" &

Request.form("changedate1") & "' , notice.ChangeTime='" &

Request.form("changetime1")  & "' WHERE (((notice.NoticeID)='" &

Request.form("notice1") & "') AND ((notice.CategoryID)='" &

Request.form("category1") & "') AND ((notice.CreatedBy)='" &

Request.form("createby1") & "') AND ((notice.CreationDate)=#" &

Request.form("createdate1") & "#)" AND ((notice.CreationTime)='" &

Request.form("createtime1") & "'))"

--------------------------------^





or like this :



Set DataConn = Server.CreateObject("ADODB.Connection")

DataConn.ConnectionTimeout = 15

DataConn.CommandTimeout = 30

DataConn.Open "DSN=CarCustomize"

Set cmdTemp = Server.CreateObject("ADODB.Command")

Set rstemp = Server.CreateObject("ADODB.Recordset")

Dim sSQL

sSQL =  "UPDATE notice SET notice.NoticeTitle='" & Request.form("title1") &

"', notice.NoticeBody='" & Request.form("body1") & "', notice.ChangeBy='" &

Request.form("changeby1") & "', notice.ChangeDate='" &

Request.form("changedate1") & "' , notice.ChangeTime='" &

Request.form("changetime1")  & "' WHERE (((notice.NoticeID)='" &

Request.form("notice1") & "') AND ((notice.CategoryID)='" &

Request.form("category1") & "') AND ((notice.CreatedBy)='" &

Request.form("createby1") & "') AND ((notice.CreationDate)=#" &

Request.form("createdate1") & "#)" AND ((notice.CreationTime)='" &

Request.form("createtime1") & "'))"

Response.Write(sSQL)

cmdTemp.CommandText = sSQL

Set cmdTemp.ActiveConnection = DataConn

rstemp.Open cmdTemp, , adOpenKeyset, adLockOptimistic     %>









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

From: Ken Schaefer [mailto:ken@a...]

Sent: Thursday, February 15, 2001 2:37 PM

To: ASP Databases

Subject: [asp_databases] RE: How to write an asp code to update data f

rom the database ?





It means:



Response.Write() your SQL string to the screen. Cut and paste the output

into and email message and send it to the list.



Cheers

Ken



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

From: "Lizawati Bakri" <LIZA_B@e...>

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

Sent: Thursday, February 15, 2001 11:59 AM

Subject: [asp_databases] RE: How to write an asp code to update data f rom

the database ?





> What do you mean by send the result of the print line..?

>

> -----Original Message-----

> From: Gregory_Griffiths@c...

> [mailto:Gregory_Griffiths@c...]

> Sent: Wednesday, February 14, 2001 4:55 PM

> To: ASP Databases

> Subject: [asp_databases] RE: How to write an asp code to update data

> from the database ?

>

>

> Please send us the results of the print line :

>

> Response.Write(sSQL)

>

> I think that this could reveal the cause of your problem.

>







--- 

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!  




$subst('Email.Unsub')




Message #8 by Gregory_Griffiths@c... on Thu, 15 Feb 2001 09:17:19 +0000
Liza,

    can you please send the exact output of that line as it may show 

the cause of the error.



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

From: LIZA_B@e... [mailto:LIZA_B@e...]

Sent: 15 February 2001 01:22

To: asp_databases@p...

Cc: LIZA_B@e...

Subject: [asp_databases] RE: How to write an asp code to update data f 

rom the database ?







It should be update the notice title ,notice body,and who change the 

notice ... 



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

From: Gregory_Griffiths@c... 

[ mailto:Gregory_Griffiths@c...] 

Sent: Wednesday, February 14, 2001 4:55 PM 

To: ASP Databases 

Subject: [asp_databases] RE: How to write an asp code to update data 

from the database ? 





Please send us the results of the print line : 



Response.Write(sSQL) 



I think that this could reveal the cause of your problem. 



> -----Original Message----- 

> From: LIZA_B@e... [ mailto:LIZA_B@e...] 

> Sent: 14 February 2001 14:47 

> To: asp_databases@p... 

> Cc: LIZA_B@e... 

> Subject: [asp_databases] How to write an asp code to update data from 

> the database ? 

> 

> 

> This message is in MIME format. Since your mail reader does 

> not understand 

> this format, some or all of this message may not be legible. 

> 

> ------_=_NextPart_001_01C09634.C7E99054 

> Content-Type: text/plain; 

>       charset="iso-8859-1" 

> 

> I have a program to update data from database but I always 

> receive an error 

>  because of the program... 

> 

> I receive an error 

>  Microsoft VBScript compilation error '800a0409' 

>  Unterminated string constant 

>  /redesign/cgi-bin/intranet/liza/updatenotice.asp, line 26 

> sSQL =  "UPDATE notice SET notice.NoticeTitle='" & 

> Request.form("title1") 

> "', notice.NoticeBody='" & Request.form("body1") & "', 

> notice.ChangeBy='" 

> Request.form("changeby1") & "', notice.ChangeDate='" 

> Request.form("changedate1") & "' , notice.ChangeTime='" 

> Request.form("changetime1")  & "' WHERE (((notice.NoticeID)='" 

> Request.form("notice1") & "') AND ((notice.CategoryID)='" 

> Request.form("category1") & "') AND ((notice.CreatedBy)='" 

> Request.form("createby1") & "') AND ((notice.CreationDate)=#" 

> Request.form("createdate1") & "#) 

>  

> -------------------------------------------------------------- 

> -------------- 

> ------^ 

> 

>   so i have change it to :- first it without ("createdate1") 

> & "#) then i 

>  change it to:- ("createdate1") & "#)" 

> 

>  this is my program: 

> 

>  Set DataConn = Server.CreateObject("ADODB.Connection") 

> DataConn.ConnectionTimeout = 15 

> DataConn.CommandTimeout = 30 

> DataConn.Open "DSN=CarCustomize" 

> Set cmdTemp = Server.CreateObject("ADODB.Command") 

> Set rstemp = Server.CreateObject("ADODB.Recordset") 

> Dim sSQL 

> sSQL =  "UPDATE notice SET notice.NoticeTitle='" & 

> Request.form("title1") & 

> "', notice.NoticeBody='" & Request.form("body1") & "', 

> notice.ChangeBy='" & 

> Request.form("changeby1") & "', notice.ChangeDate='" & 

> Request.form("changedate1") & "' , notice.ChangeTime='" & 

> Request.form("changetime1")  & "' WHERE (((notice.NoticeID)='" & 

> Request.form("notice1") & "') AND ((notice.CategoryID)='" & 

> Request.form("category1") & "') AND ((notice.CreatedBy)='" & 

> Request.form("createby1") & "') AND ((notice.CreationDate)=#" & 

> Request.form("createdate1") & "#)" AND ((notice.CreationTime)='" & 

> Request.form("createtime1") & "'))" 

> Response.Write(sSQL) 

> cmdTemp.CommandText = sSQL 

> Set cmdTemp.ActiveConnection = DataConn 

> rstemp.Open cmdTemp, , adOpenKeyset, adLockOptimistic    

> 

> 

> Is my syntax of the program is correct ? If not please write 

> the correct 

> one.. 

> 

> 

> 

> 

> 

> 

> 

> ------_=_NextPart_001_01C09634.C7E99054 

> Content-Type: text/html; 

>       charset="iso-8859-1" 

> Content-Transfer-Encoding: quoted-printable 

> 

> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> 

> <HTML> 

> <HEAD> 

> <META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; = 

> charset=3Diso-8859-1"> 

> <META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version = 

> 5.5.2650.12"> 

> <TITLE>How to write an asp code to update data from the database = 

> ?</TITLE> 

> </HEAD> 

> <BODY> 

> 

> <P><FONT SIZE=3D2 FACE=3D"Courier New">I have a program to 

> update data = 

> from database but I always receive an error</FONT> 

> <BR><FONT SIZE=3D2 FACE=3D"Courier New"> because of the = 

> program...</FONT> 

> </P> 

> 

> <P><FONT SIZE=3D2 FACE=3D"Courier New">I receive an error</FONT> 

> <BR><FONT SIZE=3D2 FACE=3D"Courier New"> Microsoft VBScript = 

> compilation error '800a0409'</FONT> 

> <BR><FONT SIZE=3D2 FACE=3D"Courier New"> Unterminated string = 

> constant</FONT> 

> <BR><FONT SIZE=3D2 FACE=3D"Courier = 

> New"> /redesign/cgi-bin/intranet/liza/updatenotice.asp, line = 

> 26</FONT> 

> <BR><FONT SIZE=3D2 FACE=3D"Courier New">sSQL =3D  "UPDATE = 

> notice SET notice.NoticeTitle=3D'" & = 

> Request.form("title1")  "', = 

> notice.NoticeBody=3D'" & 

> Request.form("body1") & = 

> "', notice.ChangeBy=3D'"  = 

> Request.form("changeby1") & "', = 

> notice.ChangeDate=3D'"  

> Request.form("changedate1") = 

> & "' , notice.ChangeTime=3D'"  = 

> Request.form("changetime1")  & "' WHERE = 

> (((notice.NoticeID)=3D'"  

> Request.form("notice1") = 

> & "') AND ((notice.CategoryID)=3D'"  = 

> Request.form("category1") & "') AND = 

> ((notice.CreatedBy)=3D'"  

> Request.form("createby1") = 

> & "') AND ((notice.CreationDate)=3D#"  = 

> Request.form("createdate1") & "#)</FONT></P> 

> 

> <P><FONT SIZE=3D2 FACE=3D"Courier = 

> New"> --------------------------------------------------- 

> ----------= 

> ---------------------^</FONT> 

> </P> 

> 

> <P><FONT SIZE=3D2 FACE=3D"Courier New">  so i have 

> change it to :- = 

> first it without ("createdate1") & "#) 

> then i</FONT> 

> <BR><FONT SIZE=3D2 FACE=3D"Courier New"> change it to:- = 

> ("createdate1") & "#)"</FONT> 

> </P> 

> 

> <P><FONT SIZE=3D2 FACE=3D"Courier New"> this is my 

> program:</FONT> 

> </P> 

> 

> <P><FONT SIZE=3D2 FACE=3D"Courier New"></FONT> <FONT = 

> COLOR=3D"#800000" SIZE=3D2 FACE=3D"Courier New">Set DataConn =3D = 

> Server.CreateObject("ADODB.Connection")</FONT> 

> <BR><FONT COLOR=3D"#800000" SIZE=3D2 FACE=3D"Courier = 

> New">DataConn.ConnectionTimeout =3D 15</FONT> 

> <BR><FONT COLOR=3D"#800000" SIZE=3D2 FACE=3D"Courier = 

> New">DataConn.CommandTimeout =3D 30</FONT> 

> <BR><FONT COLOR=3D"#800000" SIZE=3D2 FACE=3D"Courier 

> New">DataConn.Open = 

> "DSN=3DCarCustomize"</FONT> 

> <BR><FONT COLOR=3D"#800000" SIZE=3D2 FACE=3D"Courier New">Set 

> cmdTemp = 

> =3D Server.CreateObject("ADODB.Command")</FONT> 

> <BR><FONT COLOR=3D"#800000" SIZE=3D2 FACE=3D"Courier New">Set rstemp 

= 

> =3D Server.CreateObject("ADODB.Recordset")</FONT> 

> <BR><FONT COLOR=3D"#800000" SIZE=3D2 FACE=3D"Courier New">Dim = 

> sSQL</FONT> 

> <BR><FONT COLOR=3D"#800000" SIZE=3D2 FACE=3D"Courier New">sSQL = 

> =3D  "UPDATE notice SET notice.NoticeTitle=3D'" & 

= 

> Request.form("title1") & "', = 

> notice.NoticeBody=3D'" & 

> Request.form("body1") & = 

> "', notice.ChangeBy=3D'" & = 

> Request.form("changeby1") & "', = 

> notice.ChangeDate=3D'" & 

> Request.form("changedate1") = 

> & "' , notice.ChangeTime=3D'" & = 

> Request.form("changetime1")  & "' WHERE = 

> (((notice.NoticeID)=3D'" & 

> Request.form("notice1") = 

> & "') AND ((notice.CategoryID)=3D'" & = 

> Request.form("category1") & "') AND = 

> ((notice.CreatedBy)=3D'" & 

> Request.form("createby1") = 

> & "') AND ((notice.CreationDate)=3D#" & = 

> Request.form("createdate1") & "#)" AND = 

> ((notice.CreationTime)=3D'" & = 

> Request.form("createtime1") & 

"'))"</FONT></P> 

> 

> <P><FONT COLOR=3D"#800000" SIZE=3D2 FACE=3D"Courier = 

> New">Response.Write(sSQL)</FONT> 

> <BR><FONT COLOR=3D"#800000" SIZE=3D2 FACE=3D"Courier = 

> New">cmdTemp.CommandText =3D sSQL</FONT> 

> <BR><FONT COLOR=3D"#800000" SIZE=3D2 FACE=3D"Courier New">Set = 

> cmdTemp.ActiveConnection =3D DataConn</FONT> 

> <BR><FONT COLOR=3D"#800000" SIZE=3D2 FACE=3D"Courier 

> New">rstemp.Open = 

> cmdTemp, , adOpenKeyset, adLockOptimistic    </FONT> 

> </P> 

> <BR> 

> 

> <P><B><FONT COLOR=3D"#FF0000" SIZE=3D2 FACE=3D"Courier New">Is my = 

> syntax of the program is correct ? If not please write the correct = 

> one..</FONT></B> 

> </P> 

> <BR> 

> <BR> 

> <BR> 

> <BR> 

> <BR> 

> 

> 

> ---<BR> 

> FREE WEB DEVELOPMENT CODE, CONTENT, AND INSIGHTS<BR> 

> IN YOUR INBOX!<BR> 

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

> tools, and <BR> 

> developments from the experts.  Sign up for one or more of 

> EarthWeb's<BR> 

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

> ---<BR> 


> gregory_griffiths@c...<BR> 


> $subst('Email.Unsub')<BR> 

> 

> 

---<BR> 

You are currently subscribed to asp_databases as: LIZA_B@e...<BR> 


$subst('Email.Unsub')<BR> 



</BODY> 

> </HTML> 

> ------_=_NextPart_001_01C09634.C7E99054-- 

> 

> 









Message #9 by Gregory_Griffiths@c... on Thu, 15 Feb 2001 10:13:01 +0000
Liza,

    your error is the fact that you have "#)"  on the bottom line, you 

only need "#)



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

From: LIZA_B@e... [mailto:LIZA_B@e...]

Sent: 15 February 2001 06:44

To: asp_databases@p...

Cc: LIZA_B@e...

Subject: [asp_databases] RE: How to write an asp code to update data f 

rom the database ?







Like this : 



Microsoft VBScript compilation error '800a03ea' 



Syntax error 



/redesign/cgi-bin/intranet/liza/updatenotice.asp, line 26 



sSQL =  "UPDATE notice SET notice.NoticeTitle='" & 

Request.form("title1") & "', notice.NoticeBody='" & 

Request.form("body1") & "', notice.ChangeBy='" & 

Request.form("changeby1") & "', notice.ChangeDate='" & 

Request.form("changedate1") & "' , notice.ChangeTime='" & 

Request.form("changetime1")  & "' WHERE (((notice.NoticeID)='" & 

Request.form("notice1") & "') AND ((notice.CategoryID)='" & 

Request.form("category1") & "') AND ((notice.CreatedBy)='" & 

Request.form("createby1") & "') AND ((notice.CreationDate)=#" & 

Request.form("createdate1") & "#)" AND ((notice.CreationTime)='" & 

Request.form("createtime1") & "'))"



--------------------------------^ 





or like this : 



Set DataConn = Server.CreateObject("ADODB.Connection") 

DataConn.ConnectionTimeout = 15 

DataConn.CommandTimeout = 30 

DataConn.Open "DSN=CarCustomize" 

Set cmdTemp = Server.CreateObject("ADODB.Command") 

Set rstemp = Server.CreateObject("ADODB.Recordset") 

Dim sSQL 

sSQL =  "UPDATE notice SET notice.NoticeTitle='" & 

Request.form("title1") & "', notice.NoticeBody='" & 

Request.form("body1") & "', notice.ChangeBy='" & 

Request.form("changeby1") & "', notice.ChangeDate='" & 

Request.form("changedate1") & "' , notice.ChangeTime='" & 

Request.form("changetime1")  & "' WHERE (((notice.NoticeID)='" & 

Request.form("notice1") & "') AND ((notice.CategoryID)='" & 

Request.form("category1") & "') AND ((notice.CreatedBy)='" & 

Request.form("createby1") & "') AND ((notice.CreationDate)=#" & 

Request.form("createdate1") & "#)" AND ((notice.CreationTime)='" & 

Request.form("createtime1") & "'))"



Response.Write(sSQL) 

cmdTemp.CommandText = sSQL 

Set cmdTemp.ActiveConnection = DataConn 

rstemp.Open cmdTemp, , adOpenKeyset, adLockOptimistic     %> 









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

From: Ken Schaefer [ mailto:ken@a...] 

Sent: Thursday, February 15, 2001 2:37 PM 

To: ASP Databases 

Subject: [asp_databases] RE: How to write an asp code to update data f 

rom the database ? 





It means: 



Response.Write() your SQL string to the screen. Cut and paste the 

output 

into and email message and send it to the list. 



Cheers 

Ken 



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

From: "Lizawati Bakri" <LIZA_B@e...> 

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

Sent: Thursday, February 15, 2001 11:59 AM 

Subject: [asp_databases] RE: How to write an asp code to update data f 

rom 

the database ? 





> What do you mean by send the result of the print line..? 

> 

> -----Original Message----- 

> From: Gregory_Griffiths@c... 

> [ mailto:Gregory_Griffiths@c...] 

> Sent: Wednesday, February 14, 2001 4:55 PM 

> To: ASP Databases 

> Subject: [asp_databases] RE: How to write an asp code to update data 

> from the database ? 

> 

> 

> Please send us the results of the print line : 

> 

> Response.Write(sSQL) 

> 

> I think that this could reveal the cause of your problem. 

> 





Message #10 by "Wally Burfine" <oopconsultant@h...> on Thu, 15 Feb 2001 15:11:28 -0000
The problem is here:



-----------------------------------/

>Request.form("createdate1") & "#)" AND ((notice.CreationTime)='" &

>Request.form("createtime1") & "'))"

>--------------------------------^



The extra " begore the and terminates the string. Then the interpertor tries 

to logical AND then next stuff together. Things go down hill from there.



Regards

Wally







>From: Lizawati Bakri <LIZA_B@e...>

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

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

>Subject: [asp_databases] RE: How to write an asp code to update data f      

>     rom the database ?

>Date: Thu, 15 Feb 2001 14:44:22 +0800

>

>Like this :

>

>Microsoft VBScript compilation error '800a03ea'

>

>Syntax error

>

>/redesign/cgi-bin/intranet/liza/updatenotice.asp, line 26

>

>sSQL =  "UPDATE notice SET notice.NoticeTitle='" & Request.form("title1") &

>"', notice.NoticeBody='" & Request.form("body1") & "', notice.ChangeBy='" &

>Request.form("changeby1") & "', notice.ChangeDate='" &

>Request.form("changedate1") & "' , notice.ChangeTime='" &

>Request.form("changetime1")  & "' WHERE (((notice.NoticeID)='" &

>Request.form("notice1") & "') AND ((notice.CategoryID)='" &

>Request.form("category1") & "') AND ((notice.CreatedBy)='" &

>Request.form("createby1") & "') AND ((notice.CreationDate)=#" &

>Request.form("createdate1") & "#)" AND ((notice.CreationTime)='" &

>Request.form("createtime1") & "'))"

>--------------------------------^

>

>

>or like this :

>

>Set DataConn = Server.CreateObject("ADODB.Connection")

>DataConn.ConnectionTimeout = 15

>DataConn.CommandTimeout = 30

>DataConn.Open "DSN=CarCustomize"

>Set cmdTemp = Server.CreateObject("ADODB.Command")

>Set rstemp = Server.CreateObject("ADODB.Recordset")

>Dim sSQL

>sSQL =  "UPDATE notice SET notice.NoticeTitle='" & Request.form("title1") &

>"', notice.NoticeBody='" & Request.form("body1") & "', notice.ChangeBy='" &

>Request.form("changeby1") & "', notice.ChangeDate='" &

>Request.form("changedate1") & "' , notice.ChangeTime='" &

>Request.form("changetime1")  & "' WHERE (((notice.NoticeID)='" &

>Request.form("notice1") & "') AND ((notice.CategoryID)='" &

>Request.form("category1") & "') AND ((notice.CreatedBy)='" &

>Request.form("createby1") & "') AND ((notice.CreationDate)=#" &

>Request.form("createdate1") & "#)" AND ((notice.CreationTime)='" &

>Request.form("createtime1") & "'))"

>Response.Write(sSQL)

>cmdTemp.CommandText = sSQL

>Set cmdTemp.ActiveConnection = DataConn

>rstemp.Open cmdTemp, , adOpenKeyset, adLockOptimistic     %>

>

>

>

>

>-----Original Message-----

>From: Ken Schaefer [mailto:ken@a...]

>Sent: Thursday, February 15, 2001 2:37 PM

>To: ASP Databases

>Subject: [asp_databases] RE: How to write an asp code to update data f

>rom the database ?

>

>

>It means:

>

>Response.Write() your SQL string to the screen. Cut and paste the output

>into and email message and send it to the list.

>

>Cheers

>Ken

>

>----- Original Message -----

>From: "Lizawati Bakri" <LIZA_B@e...>

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

>Sent: Thursday, February 15, 2001 11:59 AM

>Subject: [asp_databases] RE: How to write an asp code to update data f rom

>the database ?

>

>

> > What do you mean by send the result of the print line..?

> >

> > -----Original Message-----

> > From: Gregory_Griffiths@c...

> > [mailto:Gregory_Griffiths@c...]

> > Sent: Wednesday, February 14, 2001 4:55 PM

> > To: ASP Databases

> > Subject: [asp_databases] RE: How to write an asp code to update data

> > from the database ?

> >

> >

> > Please send us the results of the print line :

> >

> > Response.Write(sSQL)

> >

> > I think that this could reveal the cause of your problem.

> >

>

>

  Return to Index