Ask a Question related to ASP, Design and Development.
-
ree #1
Annoying syntax error
For some reason I can't pin point, it is just bugging me like hell.
<%
dim strQuery
strQuery = "UPDATE Gifts SET"
strQuery = strQuery & " GuestSelected = " & cint(guestID)
strQuery = strQuery & ", DateSelected = " & Now()
strQuery = strQuery & " WHERE GiftID = " & selectGiftID' &
";"
Line 47 -> conn.Execute(strQuery)
%>
Error message
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing
operator) in query expression '21/10/2003 12:19:31 AM'.
/selectGift.asp, line 47
Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
Page:
POST 8 bytes to /selectGift.asp
POST Data:
GiftID=5
Time:
Tuesday, 21 October 2003, 12:19:31 AM
Thanks
ree Guest
-
Annoying imode.js error resolved
There is an invalid XML declaration extention which causes that annoying imode.js error in dreamweaver mx 2004. Took several hours for me to... -
really annoying coldfusion MX java error
Hi there, Anyone know why the following error occurs when trying to run a recently edited cfm file? I know a solution is to delte all of the old... -
error : syntax error at or near $1 for over select rows
This is the error i am getting when calling select * from cas_reset_qi_changedate('CAS','2003-02-03' ERROR: syntax error at or near "$1" at... -
annoying error
I have a asp.net app. ( been working fine so far ) Has anyone seen this before; "Cannot execute a program. The command being executed was... -
Annoying IMP error
Hi, I'm getting the following errorwhen importing my database from one server to another. .. . importing table "WWW_POLL" ... -
Aaron Bertrand - MVP #2
Re: Annoying syntax error
> strQuery = strQuery & ", DateSelected = " & Now()
Access requies # to delimit dates, but Access also knows what now() is, so
instead of trying to concatenate from ASP, just say
strQuery = strQuery & ", DateSelected = Now()"
And stop using ODBC.> Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
> [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing
> operator) in query expression '21/10/2003 12:19:31 AM'.
[url]http://www.aspfaq.com/2126[/url]
Aaron Bertrand - MVP Guest
-
Tom B #3
Re: Annoying syntax error
In access, your dates need to be surrounded by #'s.
"ree" <ree@hotmail.coom> wrote in message
news:Xns941B3A5A27B4reehotmailcoom@210.49.20.254.. .> For some reason I can't pin point, it is just bugging me like hell.
>
> <%
> dim strQuery
> strQuery = "UPDATE Gifts SET"
> strQuery = strQuery & " GuestSelected = " & cint(guestID)
> strQuery = strQuery & ", DateSelected = " & Now()
> strQuery = strQuery & " WHERE GiftID = " & selectGiftID' &
> ";"
>
> Line 47 -> conn.Execute(strQuery)
> %>
>
>
>
> Error message
>
> Error Type:
> Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
> [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing
> operator) in query expression '21/10/2003 12:19:31 AM'.
> /selectGift.asp, line 47
>
>
> Browser Type:
> Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
>
> Page:
> POST 8 bytes to /selectGift.asp
>
> POST Data:
> GiftID=5
>
> Time:
> Tuesday, 21 October 2003, 12:19:31 AM
>
>
> Thanks
Tom B Guest
-
Randy Rahbar #4
Re: Annoying syntax error
> strQuery = strQuery & " WHERE GiftID = " & selectGiftID' &
What's with the single quote after selectGiftID?
You might want to lose that too. Assuming selectGiftID is numeric, change> ";"
the last line to...
strQuery = strQuery & " WHERE GiftID = " & selectGiftID
Randy Rahbar Guest
-
Ray at #5
Re: Annoying syntax error
"ree" <ree@hotmail.coom> wrote in message
news:Xns941B3A5A27B4reehotmailcoom@210.49.20.254.. .Dates are delimited with # in Access databases.> For some reason I can't pin point, it is just bugging me like hell.
>
> <%
> dim strQuery
> strQuery = "UPDATE Gifts SET"
> strQuery = strQuery & " GuestSelected = " & cint(guestID)
> strQuery = strQuery & ", DateSelected = " & Now()
> strQuery = strQuery & " WHERE GiftID = " & selectGiftID' & ";"
>
> Line 47 -> conn.Execute(strQuery)
> %>
>
>
<%
strQuery = "UPDATE Gifts SET"
strQuery = strQuery & " GuestSelected = " & cint(guestID)
strQuery = strQuery & ", DateSelected = #" & Now() & "#"
strQuery = strQuery & " WHERE GiftID = " & selectGiftID
%>
Ray at work
Ray at Guest
-
Ray at #6
Re: Annoying syntax error
There was a line-wrap issue there in your newsreader. He was actually
commenting out the " & ";"" part. At least that's how I interpreted after
questioning it also.
Ray at work
"Randy Rahbar" <rvrahbarAThotmail.com> wrote in message
news:eFDYTbxlDHA.976@tk2msftngp13.phx.gbl...>> > strQuery = strQuery & " WHERE GiftID = " & selectGiftID' &
> What's with the single quote after selectGiftID?
>>> > ";"
> You might want to lose that too. Assuming selectGiftID is numeric, change
> the last line to...
> strQuery = strQuery & " WHERE GiftID = " & selectGiftID
>
>
Ray at Guest
-
Randy Rahbar #7
Re: Annoying syntax error
> There was a line-wrap issue there in your newsreader. He was actually
Whoops... yeah, that makes more sense. Thanks :)> commenting out the " & ";"" part. At least that's how I interpreted after
> questioning it also.
Randy Rahbar Guest
-
ree #8
Re: Annoying syntax error
"Aaron Bertrand - MVP" <aaron@TRASHaspfaq.com> wrote in
news:#OaiRaxlDHA.684@TK2MSFTNGP09.phx.gbl:
>>> strQuery = strQuery & ", DateSelected = " & Now()
> Access requies # to delimit dates, but Access also knows what now()
> is, so instead of trying to concatenate from ASP, just say
>
> strQuery = strQuery & ", DateSelected = Now()"
Thanks guys but for some reason not doing what I did before strangely work
on another page.
ree Guest
-
ree #9
Re: Annoying syntax error
>
> Dates are delimited with # in Access databases.
>
> strQuery = strQuery & ", DateSelected = #" & Now() & "#"
> strQuery = strQuery & " WHERE GiftID = " & selectGiftID
>
> %>
Thanks guys but for some reason not doing what I did before strangely work
on another page.
ree Guest



Reply With Quote

