Re: Help I am getting an error when I run my insert statement



Tescumeh said (on or about) 12/11/2006 15:16:
Please help I am getting the same error no matter how I change my
quotes.
Microsoft OLE DB Provider for SQL Server error '80040e14'

Incorrect syntax near the keyword 'Plan'.

conn.Execute("INSERT INTO jmiles.Plan([startdate],[finishdate],
[revfinish],[responsible],[action],[title],[dept],[author],[type])
values ('" & request.Form("startdate") &"' ,"&
Request.Form("finishdate") &" ," & Request.Form("revfinish") & ",'" &
Request.Form("responsible") & "','" & Request.Form("action") & "','" &
Request.Form("title") & "','" & Request.Form("dept") & "','" &
session("empid") & "','" & Request.form("type") & "')")
'set Rs =conn.Execute("SELECT * FROM Equipment")

startdate, finshdate,revfinish are all smalldatetime
[Action], responsible, dept, author, type are all text
title is nvarchar

any Ideas?


When I have a problem like that, I find it very helpful to
break the code into parts so I can assign the SQL statement
to a variable, place a breakpoint in the code and inspect
the variable. Then I try copying the SQL and pasting it
into Query Analyzer. It almost always shows me the exact
problem.
.



Relevant Pages

  • Please Help with Transaction + Alter Procedure statement
    ... I am struggling with the following SQL. ... Incorrect syntax near the keyword 'PROCEDURE'. ... Must declare the variable '@mySomething'. ...
    (microsoft.public.sqlserver)
  • Re: Error when calling the OleDbDataAdapter.Fill() method
    ... Have you tried copying and pasting the query into an Access query ... it is caused by using a keyword as a fieldname in my database. ... Here is the SQL statement I am executing (I am using Microsoft Access as my ... SELECT headline,url,summary,updated FROM worldnews EXCEPT (SELECT ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Incorrect syntax near the keyword Close
    ... Wayne Snyder, MCDBA, SQL Server MVP ... I support the Professional Association of SQL Server and it's community of SQL Server professionals. ... > Incorrect syntax near the keyword 'Close'. ...
    (microsoft.public.sqlserver.server)
  • Re: SQL to Linq - Left, Right and Inner Joins
    ... At least, for me, that helps to see the process as being a double translation, and to STOP thinking in SQL sets, while using LINQ, but to then think in terms of for-each sequences. ... The second 'table' is introduced with the keyword join rather than with the keyword from, as previously, the on keyword introduces the relation, always an equality. ... There is no LINQ-Right outer join, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: SQL to Linq - Left, Right and Inner Joins
    ... expression tree which will be TRANSLATED to an SQL statement. ... LINQ: from a in b ... The second 'table' is introduced with the keyword join rather than with the ... There is no LINQ-Right outer join, ...
    (microsoft.public.dotnet.languages.csharp)