Friday, March 30, 2012

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

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],[a
uthor],[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?Try the OLEDB group?
"Tescumeh" <tescumeh@.gmail.com> wrote in message
news:1165868180.115810.136290@.l12g2000cwl.googlegroups.com...
> 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?
>|||What error message are you getting?
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
You can't help someone get up a hill without getting a little closer to the
top yourself.
- H. Norman Schwarzkopf
"Tescumeh" <tescumeh@.gmail.com> wrote in message
news:1165868180.115810.136290@.l12g2000cwl.googlegroups.com...
> 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?
>|||Imposter!
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
You can't help someone get up a hill without getting a little closer to the
top yourself.
- H. Norman Schwarzkopf
"Arnie" <99yoda@.newsgroup.nospam> wrote in message
news:u0e%23N%23XHHHA.3616@.TK2MSFTNGP02.phx.gbl...
> Try the OLEDB group?
>
> "Tescumeh" <tescumeh@.gmail.com> wrote in message
> news:1165868180.115810.136290@.l12g2000cwl.googlegroups.com...
>|||Microsoft OLE DB Provider for SQL Server error '80040e14'
Incorrect syntax near the keyword 'Plan'.
imposter?|||> imposter?
We're both "Arnie".
- Arnie|||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.|||Thank you I will try that.

No comments:

Post a Comment