Re: Something wrong with my INSERT INTO
- From: "Bob Barrows [MVP]" <reb01501@xxxxxxxxxxxxxxx>
- Date: Tue, 11 Apr 2006 14:02:54 -0400
Maxi wrote:
Bob Barrows [MVP] wrote:
Maxi wrote:
I did something with the code and changed it a bit.
Yeah, you added On Error resume Next, which is now masking your
error. :-)
I removed the On error line and now I get error:
Error Type:
Microsoft JET Database Engine (0x80040E14)
Syntax error in INSERT INTO statement.
/v/results.asp, line 14
What is wrong with the INSERT INTO statement.
The only way to find out is to look at it. the only way to look at it is to
response.write it.
sql = "INSERT ... "
Response.Write sql
Response.End
Run the page and look at the statement in the browser. Try opening your
database in Access and running the sql statement there. If you still can't
figure it out, look at the rules for delimiters in sql statements which I
talk about in this post:
http://www.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=e6lLVvOcDHA.1204%40TK2MSFTNGP12.phx.gbl
If you still can't figure it out, post the datatypes of the fields in your
table and the ssql statement that got written to the browser window.
Or is it that the errorNo. the error message is very specific. It's definitely coming from the
is somewhere else?
database (note the source: JET)
You use of dynamic sql is leaving you vulnerable to hackers using sql
injection:
I am not worried about hackers as I am not going to host this. This is
for my employees. The reason why I selected ASP is because these guys
don't have excel to enter data.
The majority of hacks are done by disgruntled employees ...
See here for a better, more secure way to execute your queries by
using parameter markers:
Personally, I prefer using stored procedures, or saved parameter
queries as they are known in Access:
I don't want to make my code better, efficient or effective.
How about easier-to-write? Doesn't that appeal?
Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
.
- Follow-Ups:
- Re: Something wrong with my INSERT INTO
- From: Maxi
- Re: Something wrong with my INSERT INTO
- References:
- Something wrong with my INSERT INTO
- From: Maxi
- Re: Something wrong with my INSERT INTO
- From: Maxi
- Re: Something wrong with my INSERT INTO
- From: Bob Barrows [MVP]
- Re: Something wrong with my INSERT INTO
- From: Maxi
- Something wrong with my INSERT INTO
- Prev by Date: Re: Something wrong with my INSERT INTO
- Next by Date: Re: Changing IE Settings
- Previous by thread: Re: Something wrong with my INSERT INTO
- Next by thread: Re: Something wrong with my INSERT INTO
- Index(es):
Relevant Pages
|