asp_databases thread: help with update statement
Message #1 by JonGrman21@a... on Mon, 28 Aug 2000 10:52:48 EDT
|
|
i need help with my update statment. Im trying to update a record in the
database but when i try and do " where Id = " & request.form("strId") i get
an error saying...syntax error (missing operater) in query expression 'Id = '
if you have an idea whats wrong please emial me back it would be greatly
appreciated
thanx
Message #2 by mkrishna - Internet Mail <mkrishna@c...> on Mon, 28 Aug 2000 14:54:40 -0400
|
|
sql = "update sometable " _
& "set somecol = somevalue " _
& "where id = "&request.form("strId")&" "
try the above method... this should work....
normally error occurs sometimes when you use
&" where id = "& Request.form("StrId")
and request.form("strId") doesnot retrieve anything.
But here close the statement like this
&" where id = "& Request.form("StrId") &" "
hope this helps
murali
> -----Original Message-----
> From: JonGrman21@a...
> Sent: Monday, August 28, 2000 10:53 AM
> To: ASP Databases
> Subject: [asp_databases] help with update statement
>
> i need help with my update statment. Im trying to update a record in the
>
> database but when i try and do " where Id = " & request.form("strId") i
> get
> an error saying...syntax error (missing operater) in query expression 'Id
> = '
>
> if you have an idea whats wrong please emial me back it would be greatly
> appreciated
> thanx
>
Message #3 by "James Q. Stansfield" <jstansfield@t...> on Mon, 28 Aug 2000 14:53:32 -0400
|
|
If, by your code convention, strId is a string variable then the SQL
statement needs single quotes around the variable like this:
... WHERE Id = '" & Request.Form("strId") & "'"
--Cheers
-----Original Message-----
From: JonGrman21@a... [mailto:JonGrman21@a...]
Sent: Monday, August 28, 2000 10:53 AM
To: ASP Databases
Subject: [asp_databases] help with update statement
i need help with my update statment. Im trying to update a record in the
database but when i try and do " where Id = " & request.form("strId") i get
an error saying...syntax error (missing operater) in query expression 'Id
'
if you have an idea whats wrong please emial me back it would be greatly
appreciated
thanx
---
You are currently subscribed to asp_databases
Message #4 by "Joe Sabado" <joe.sabado@g...> on Mon, 28 Aug 2000 11:47:29 -0700
|
|
Could you please post the code.
----- Original Message -----
From: <JonGrman21@a...>
To: ASP Databases <asp_databases@p...>
Sent: Monday, August 28, 2000 7:52 AM
Subject: [asp_databases] help with update statement
> i need help with my update statment. Im trying to update a record in the
> database but when i try and do " where Id = " & request.form("strId") i
get
> an error saying...syntax error (missing operater) in query expression 'Id
= '
>
> if you have an idea whats wrong please emial me back it would be greatly
> appreciated
> thanx
>
> ---
> You are currently subscribed to asp_databases
$subst('Email.Unsub')
>
>
Message #5 by "Joe White" <jwboy78@h...> on Mon, 28 Aug 2000 13:39:13 PDT
|
|
Yeah declare your variable and use the variable. Not request.form
dim strID = request.form("id") then just use strID
>From: JonGrman21@a...
>Reply-To: "ASP Databases" <asp_databases@p...>
>To: "ASP Databases" <asp_databases@p...>
>Subject: [asp_databases] help with update statement
>Date: Mon, 28 Aug 2000 10:52:48 EDT
>
>i need help with my update statment. Im trying to update a record in the
>database but when i try and do " where Id = " & request.form("strId") i get
>an error saying...syntax error (missing operater) in query expression 'Id =
>'
>
>if you have an idea whats wrong please emial me back it would be greatly
>appreciated
>thanx
>
>---
>You are currently subscribed to asp_databases
>$subst('Email.Unsub')
>
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
Share information about yourself, create your own public profile at
http://profiles.msn.com.
Message #6 by "Andi Gladwin" <illusionist@l...> on Mon, 28 Aug 2000 19:59:10 +0100
|
|
Hi!
Its probably because of the quotes in your request.form("strId") - try
inserting it into a variable, and then inserting it into a variable first.
Hope that helps
Andi
i need help with my update statment. Im trying to update a record in the
database but when i try and do " where Id = " & request.form("strId") i get
an error saying...syntax error (missing operater) in query expression 'Id
'
if you have an idea whats wrong please emial me back it would be greatly
appreciated
thanx
---
You are currently subscribed to asp_databases
Message #7 by "Ken Schaefer" <ken@a...> on Tue, 29 Aug 2000 11:23:03 +1000
|
|
Sounds like either:
a) ID is not a field in your table
b) Request.Form("strID") contains no information.
Suggest that you do this:
Response.Write(strSQL)
and post the results to the list
Cheers
Ken
----- Original Message -----
From: <JonGrman21@a...>
To: "ASP Databases" <asp_databases@p...>
Sent: Tuesday, August 29, 2000 12:52 AM
Subject: [asp_databases] help with update statement
> i need help with my update statment. Im trying to update a record in the
> database but when i try and do " where Id = " & request.form("strId") i
get
> an error saying...syntax error (missing operater) in query expression 'Id
= '
>
> if you have an idea whats wrong please emial me back it would be greatly
> appreciated
> thanx
Message #8 by "JOHN P. PARLATO" <jparlato@m...> on Mon, 28 Aug 2000 23:57:05 -0700
|
|
Trydo " where Id = ' " & request.form("strId") & " ' "
----- Original Message -----
From: <JonGrman21@a...>
To: ASP Databases <asp_databases@p...>
Sent: Monday, August 28, 2000 7:52 AM
Subject: [asp_databases] help with update statement
> i need help with my update statment. Im trying to update a record in the
> database but when i try and do " where Id = " & request.form("strId") i
get
> an error saying...syntax error (missing operater) in query expression 'Id
= '
>
> if you have an idea whats wrong please emial me back it would be greatly
> appreciated
> thanx
>
> ---
> You are currently subscribed to asp_databases
$subst('Email.Unsub')
>
Message #9 by Dan Te Whaiti <dant@h...> on Tue, 29 Aug 2000 09:04:09 +1200
|
|
TRY PUTTING SINGLE QUOTES AROUND THE strId argument
-----Original Message-----
From: JonGrman21@a... [mailto:JonGrman21@a...]
Sent: Tuesday, August 29, 2000 2:53 AM
To: ASP Databases
Subject: [asp_databases] help with update statement
i need help with my update statment. Im trying to update a record in the
database but when i try and do " where Id = " & request.form("strId") i get
an error saying...syntax error (missing operater) in query expression 'Id
'
if you have an idea whats wrong please emial me back it would be greatly
appreciated
thanx
---
You are currently subscribed to asp_databases
*****************************************************************
Hawke's Bay Network Limited uses e-mail as a fast and relatively
informal means of communication. If in doubt as to the official
status of a message, or if you want formal confirmation, please
ask the sender. We are not responsible for any changes made to a
message and/or any attachments after sending.
*****************************************************************
Message #10 by Imar Spaanjaars <Imar@S...> on Mon, 28 Aug 2000 21:13:41 +0200
|
|
It would be really helpful if you would post some code here. There could be
like half a million of possibilities why the insert doesn't work.
Imar
At 10:52 AM 8/28/2000 -0400, you wrote:
>i need help with my update statment. Im trying to update a record in the
>database but when i try and do " where Id = " & request.form("strId") i get
>an error saying...syntax error (missing operater) in query expression 'Id = '
>
>if you have an idea whats wrong please emial me back it would be greatly
>appreciated
>thanx
>
>---
>You are currently subscribed to asp_databases
Message #11 by Gregory_Griffiths@c... on Tue, 29 Aug 2000 08:38:18 +0100
|
|
What is the value of request.form("strId") when you call it ? I think
you may find that it is undefined. Suggest that you do the following :
1. Print your SQL to the screen at run time to see the SQL and then run
that against the DB using SQL Plus or similar.
2. Check the status of the strId (e.g. is it defined, length>0 etc)
before you use it
3. Replace it in the query with a param as in teh following pseudo code
:
Dim param1 ' Dim
param1=0 ' Initialise
if request.form("strId").length>0 then
param1=request.form("strId")
end if
> -----Original Message-----
> Sent: 28 August 2000 15:53
> To: asp_databases@p...
> Subject: FW: [asp_databases] help with update statement
>
>
> i need help with my update statment. Im trying to update a
> record in the
> database but when i try and do " where Id = " &
> request.form("strId") i get
> an error saying...syntax error (missing operater) in query
> expression 'Id = '
>
> if you have an idea whats wrong please emial me back it would
> be greatly
> appreciated
> thanx
>
|