(0x80040E14) Syntax error in UPDATE statement. 
Author Message
 (0x80040E14) Syntax error in UPDATE statement.

Here's my code:

' If the Needs field is set to true the user has modified their
information and
        ' is requesting to update it.  Take the form variables and create a
SQL UPDATE statement
        ' from that info.
        If Request.Form("Needs") = "true" Then
                strSQL =        " UPDATE Needs SET " & _
                                " FA_Assess = " & request.form("TxtAssess") & " , " & _
                                " WHERE TblTeachers.TchSSN =" & Session(USER_ID)

                ' Create a command object to execute the query          
                set cmd = Server.CreateObject("ADODB.Command")
                with cmd
                        ' set the connection
                        .ActiveConnection = conn
                        ' give the object the update statement
                        .CommandText = strSQL
                        ' execute the statement against the database
                        .Execute
                end with
                ' destroy the command object
                set cmd = nothing
        End IF

**Here's the form:

<input type="text" name="TxtAssess"
value="<%=rs.Fields("FA_Assess").Value%>" size="1">

Please, I'm really new at this and I'm learning by trial and error but
lately it's been mostly error.  What am i doing wrong?  The field i'm
trying to update is a numeric field.

Thanks,

Michael



Sun, 19 Sep 2004 05:59:55 GMT
 (0x80040E14) Syntax error in UPDATE statement.

Michael,

Two good debugging rules:

(1) After forming a string to be sent to SQL Server, display it. More likely
than not, if you will what you are actually sending, you'll catch the error
;-)

(2) If (1) doesn't help, use SQL Server Profiler to see what is being
received by SQL Server.

I'm not an ASP person, but my best guess is that you have an unnecessary
comma between the SET and WHERE clauses. There might be other errors as
well.

-------------------------------------------
BP Margolin
Please reply only to the newsgroups.
When posting, inclusion of SQL (CREATE TABLE ..., INSERT ..., etc.) which
can be cut and pasted into Query Analyzer is appreciated.


Quote:
> Here's my code:

> ' If the Needs field is set to true the user has modified their
> information and
> ' is requesting to update it.  Take the form variables and create a
> SQL UPDATE statement
> ' from that info.
> If Request.Form("Needs") = "true" Then
> strSQL = " UPDATE Needs SET " & _
> " FA_Assess = " & request.form("TxtAssess") & " , " & _
> " WHERE TblTeachers.TchSSN =" & Session(USER_ID)

> ' Create a command object to execute the query
> set cmd = Server.CreateObject("ADODB.Command")
> with cmd
> ' set the connection
> .ActiveConnection = conn
> ' give the object the update statement
> .CommandText = strSQL
> ' execute the statement against the database
> .Execute
> end with
> ' destroy the command object
> set cmd = nothing
> End IF

> **Here's the form:

> <input type="text" name="TxtAssess"
> value="<%=rs.Fields("FA_Assess").Value%>" size="1">

> Please, I'm really new at this and I'm learning by trial and error but
> lately it's been mostly error.  What am i doing wrong?  The field i'm
> trying to update is a numeric field.

> Thanks,

> Michael




Sun, 19 Sep 2004 06:27:41 GMT
 (0x80040E14) Syntax error in UPDATE statement.
Actually, it's an Access database.  I'm fine with access it's SQL where
i'm really weak.  I'm reading books upon books but SQL combined with ASP
is what's throwing me.

mp

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Sun, 19 Sep 2004 06:35:25 GMT
 (0x80040E14) Syntax error in UPDATE statement.
Michael,

Access questions are best posted to an Access newsgroup.

There is quite a difference between the variants of SQL used in SQL Server
and Access.

-------------------------------------------
BP Margolin
Please reply only to the newsgroups.
When posting, inclusion of SQL (CREATE TABLE ..., INSERT ..., etc.) which
can be cut and pasted into Query Analyzer is appreciated.

Quote:
> Actually, it's an Access database.  I'm fine with access it's SQL where
> i'm really weak.  I'm reading books upon books but SQL combined with ASP
> is what's throwing me.

> mp

> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!



Sun, 19 Sep 2004 06:55:47 GMT
 
 [ 4 post ] 

 Relevant Pages 

1. (0x80040E14) Syntax error in UPDATE statement.

2. Error 0x80040e14??? syntax problem

3. Syntax error in UPDATE statement while using a Memo field

4. Syntax error in UPDATE statement

5. HE: Syntax Error in UPDATE statement

6. Syntax Error in Update Statement

7. Syntax error in UPDATE statement

8. -2147217900 Error: Syntax error in INSERT INTO statement

9. NEWBIE: easy syntax question with UPDATE statement

10. Help with SQL update statement syntax

11. SQL Update Statement Syntax Help

12. Need help with Syntax on Update or Insert SQL Statement


 
Powered by phpBB® Forum Software