Ask a Question related to ASP, Design and Development.
-
J. Muenchbourg #1
INSERT statement contains fewer items than the insert list
The block of code below shows how I am inserting field values into my
dbase table:
strSQLStatement = "INSERT INTO tblArticles
(handid,ArticleDate,sport,articleheader, fpick,articleText) "_
& "SELECT '" & handid & "' As handid, '" _
& ArticleDate & "' As ArticleDate, '" _
& sport & " As sport, " _
& articleheader & "' As articleheader, '" _
& fpick & "' As fpick, '" _
& articleText & "' As articleText;"
Conn.Execute(strSQLStatement)
...but I am getting an "Insert statement contains fewer items than the
insert list" error , when in fact I am not (both 6 field names).
????
Muench
*** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!
J. Muenchbourg Guest
-
Help with INSERT INTO statement
I'm getting the following error on a query. I haven't seen this one before. Any ideas on what I'm doing wrong? Thanks. Error Executing Database... -
problem with insert statement
HI there it seems like i get the error when inserting records into a MS Access database if the fields are null. : Error Executing Database... -
Trouble with INSERT statement
I'm trying to create my very first INSERT statement, but I keep getting an error and I can't figure out why. The error: Syntax error in INSERT... -
insert statement into a mySQL dB from PHP
I have an insert statement into a mySQL db from PHP 99% of the time the statement executes properly but occasionally no write to the db occurs,... -
Insert Statement help
Hello, I am having some difficulty keeping my data consistent throughout my tables. I have 3 tables that I need to be "synch'd up".... -
Turkbear #2
Re: INSERT statement contains fewer items than the insert list
On Tue, 30 Sep 2003 13:06:31 -0700, J. Muenchbourg <jodaddy@canada.com> wrote:
Try a>The block of code below shows how I am inserting field values into my
>dbase table:
>
>strSQLStatement = "INSERT INTO tblArticles
>(handid,ArticleDate,sport,articleheader, fpick,articleText) "_
> & "SELECT '" & handid & "' As handid, '" _
> & ArticleDate & "' As ArticleDate, '" _
> & sport & " As sport, " _
> & articleheader & "' As articleheader, '" _
> & fpick & "' As fpick, '" _
> & articleText & "' As articleText;"
>
> Conn.Execute(strSQLStatement)
>
>..but I am getting an "Insert statement contains fewer items than the
>insert list" error , when in fact I am not (both 6 field names).
>
>????
>Muench
>
>*** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
>Don't just participate in USENET...get rewarded for it!
Response.Write (strSQLStatement)
to see if perhaps the quotes or commas are getting misplaced...
Turkbear Guest
-
Harry Strybos #3
Re: INSERT statement contains fewer items than the insert list
"J. Muenchbourg" <jodaddy@canada.com> wrote in message
news:uMJUY54hDHA.2320@TK2MSFTNGP12.phx.gbl...Try this:> The block of code below shows how I am inserting field values into my
> dbase table:
>
> strSQLStatement = "INSERT INTO tblArticles
> (handid,ArticleDate,sport,articleheader, fpick,articleText) "_
> & "SELECT '" & handid & "' As handid, '" _
> & ArticleDate & "' As ArticleDate, '" _
> & sport & " As sport, " _
> & articleheader & "' As articleheader, '" _
> & fpick & "' As fpick, '" _
> & articleText & "' As articleText;"
>
> Conn.Execute(strSQLStatement)
>
> ..but I am getting an "Insert statement contains fewer items than the
> insert list" error , when in fact I am not (both 6 field names).
>
> ????
> Muench
>
> *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
> Don't just participate in USENET...get rewarded for it!
strSQLStatement = "INSERT INTO tblArticles> (handid,ArticleDate,sport,articleheader, fpick,articleText) "_
> & "VALUES (" & handid & ", " _
> & ArticleDate & ", " _
> & sport & ", " _
> & articleheader & ", " _
> & fpick & ", " _
> & articleText & ")"
Harry Strybos Guest
-
Aaron Bertrand - MVP #4
Re: INSERT statement contains fewer items than the insert list
Uh, did you mean
strSQLStatement = "INSERT tblArticles (handid, ...) VALUES('" & handid & "',
....)"
(I've never seen As used for aliases in an *insert* statement; not saying
that it wouldn't work, but it looks weird, and bloats your code
unnecessarily.)
Also, a good debugging technique, as always, is
Response.Write (strSQLStatement)
In this case, you are very likely to spot the problem without having to post
a message at all. And when you do have to post a message, you give us more
useful information than an unpopulated SQL statement...
"J. Muenchbourg" <jodaddy@canada.com> wrote in message
news:uMJUY54hDHA.2320@TK2MSFTNGP12.phx.gbl...> The block of code below shows how I am inserting field values into my
> dbase table:
>
> strSQLStatement = "INSERT INTO tblArticles
> (handid,ArticleDate,sport,articleheader, fpick,articleText) "_
> & "SELECT '" & handid & "' As handid, '" _
> & ArticleDate & "' As ArticleDate, '" _
> & sport & " As sport, " _
> & articleheader & "' As articleheader, '" _
> & fpick & "' As fpick, '" _
> & articleText & "' As articleText;"
>
> Conn.Execute(strSQLStatement)
>
> ..but I am getting an "Insert statement contains fewer items than the
> insert list" error , when in fact I am not (both 6 field names).
>
> ????
> Muench
>
> *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
> Don't just participate in USENET...get rewarded for it!
Aaron Bertrand - MVP Guest



Reply With Quote

