|
 |
asp_databases thread: Missing operator in query expresion
Message #1 by "dale Borchardt" <dale@d...> on Wed, 29 Jan 2003 15:42:54
|
|
Can you tell me what is wrong with this line,
sql6 = sql6 & " tblJobTicket.ClosedDate = #"&strClosedDate&"# "
in the code shown at the bottom of this email. I keep getting this error,
Microsoft JET Database Engine (0x80040E14)
Syntax error (missing operator) in query expression '''
tblJobTicket.ClosedDate = #1/29/2003 9:10:50 AM#'.
/MaintReq/Live/03_01_23_CallClosedTime/Strip/6UpdateEdit.asp, line 54
when I run it. Line 54 is the ?oCmd6.Execute? line. Is this a problem
with the ASP or maybe with the access db I am sending it to?
strClosedDate = Now()
' 'Start building the SQL string
sql6 = "UPDATE tblJobTicket SET tblJobTicket.AssignedTo = '" &
Request.Form("AssignedTo") & "', "
sql6 = sql6 & " tblJobTicket.StatusClosed = '" & StatusClosed & "' "
sql6 = sql6 & " tblJobTicket.ClosedDate = #"&strClosedDate&"# "
sql6 = sql6 & " WHERE tblJobTicket.ID = " & Request.Form("JobTicNum")
& ";"
'Create and open the database object
Set oConn6 = Server.CreateObject("ADODB.Connection")
oConn6.Open strconnect
'Create the command object
Set oCmd6 = Server.CreateObject("ADODB.Command")
'Set the command object properties
Set oCmd6.ActiveConnection = oConn6
oCmd6.CommandText = sql6
oCmd6.CommandType = adCmdText
'Execute the command
oCmd6.Execute
Message #2 by "Gillian Harber" <gillian@m...> on Thu, 30 Jan 2003 11:42:20 -0000
|
|
sql6 = "UPDATE tblJobTicket SET tblJobTicket.AssignedTo = '" &
Request.Form("AssignedTo") & "', "
sql6 = sql6 & " tblJobTicket.StatusClosed = '" & StatusClosed & "', "
<---here
sql6 = sql6 & " tblJobTicket.ClosedDate = #"&strClosedDate&"# "
sql6 = sql6 & " WHERE tblJobTicket.ID = " & Request.Form("JobTicNum") & ";"
I think you have just missed a comma(,) out on the end of the second of the
lines above.
Let me know if that helps.
Gillian Harber
----- Original Message -----
From: "dale Borchardt" <dale@d...>
To: "ASP Databases" <asp_databases@p...>
Sent: Wednesday, January 29, 2003 3:42 PM
Subject: [asp_databases] Missing operator in query expresion
> Can you tell me what is wrong with this line,
> sql6 = sql6 & " tblJobTicket.ClosedDate = #"&strClosedDate&"# "
> in the code shown at the bottom of this email. I keep getting this error,
> Microsoft JET Database Engine (0x80040E14)
> Syntax error (missing operator) in query expression '''
> tblJobTicket.ClosedDate = #1/29/2003 9:10:50 AM#'.
> /MaintReq/Live/03_01_23_CallClosedTime/Strip/6UpdateEdit.asp, line 54
> when I run it. Line 54 is the "oCmd6.Execute" line. Is this a problem
> with the ASP or maybe with the access db I am sending it to?
>
>
> strClosedDate = Now()
>
> ' 'Start building the SQL string
> sql6 = "UPDATE tblJobTicket SET tblJobTicket.AssignedTo = '" &
> Request.Form("AssignedTo") & "', "
> sql6 = sql6 & " tblJobTicket.StatusClosed = '" & StatusClosed & "' "
> sql6 = sql6 & " tblJobTicket.ClosedDate = #"&strClosedDate&"# "
> sql6 = sql6 & " WHERE tblJobTicket.ID = " & Request.Form("JobTicNum")
> & ";"
>
> 'Create and open the database object
> Set oConn6 = Server.CreateObject("ADODB.Connection")
> oConn6.Open strconnect
>
> 'Create the command object
> Set oCmd6 = Server.CreateObject("ADODB.Command")
>
> 'Set the command object properties
> Set oCmd6.ActiveConnection = oConn6
> oCmd6.CommandText = sql6
> oCmd6.CommandType = adCmdText
>
> 'Execute the command
> oCmd6.Execute
>
Message #3 by "dale Borchardt" <dale@d...> on Fri, 31 Jan 2003 16:46:05
|
|
Thank you.
I was way off track where I was looking.
> sql6 = "UPDATE tblJobTicket SET tblJobTicket.AssignedTo = '" &
Request.Form("AssignedTo") & "', "
sql6 = sql6 & " tblJobTicket.StatusClosed = '" & StatusClosed & "', "
<---here
sql6 = sql6 & " tblJobTicket.ClosedDate = #"&strClosedDate&"# "
sql6 = sql6 & " WHERE tblJobTicket.ID = " & Request.Form("JobTicNum")
& ";"
I think you have just missed a comma(,) out on the end of the second of
the
lines above.
Let me know if that helps.
Gillian Harber
----- Original Message -----
From: "dale Borchardt" <dale@d...>
To: "ASP Databases" <asp_databases@p...>
Sent: Wednesday, January 29, 2003 3:42 PM
Subject: [asp_databases] Missing operator in query expresion
> Can you tell me what is wrong with this line,
> sql6 = sql6 & " tblJobTicket.ClosedDate = #"&strClosedDate&"# "
> in the code shown at the bottom of this email. I keep getting this
error,
> Microsoft JET Database Engine (0x80040E14)
> Syntax error (missing operator) in query expression '''
> tblJobTicket.ClosedDate = #1/29/2003 9:10:50 AM#'.
> /MaintReq/Live/03_01_23_CallClosedTime/Strip/6UpdateEdit.asp, line
54
> when I run it. Line 54 is the "oCmd6.Execute" line. Is this a problem
> with the ASP or maybe with the access db I am sending it to?
>
>
> strClosedDate = Now()
>
> ' 'Start building the SQL string
> sql6 = "UPDATE tblJobTicket SET tblJobTicket.AssignedTo = '" &
> Request.Form("AssignedTo") & "', "
> sql6 = sql6 & " tblJobTicket.StatusClosed = '" & StatusClosed & "' "
> sql6 = sql6 & " tblJobTicket.ClosedDate = #"&strClosedDate&"# "
> sql6 = sql6 & " WHERE tblJobTicket.ID = " & Request.Form("JobTicNum")
> & ";"
>
> 'Create and open the database object
> Set oConn6 = Server.CreateObject("ADODB.Connection")
> oConn6.Open strconnect
>
> 'Create the command object
> Set oCmd6 = Server.CreateObject("ADODB.Command")
>
> 'Set the command object properties
> Set oCmd6.ActiveConnection = oConn6
> oCmd6.CommandText = sql6
> oCmd6.CommandType = adCmdText
>
> 'Execute the command
> oCmd6.Execute
>
|
|
 |