Re: problem ado with update ms access
- From: "Bob Barrows [MVP]" <reb01501@xxxxxxxxxxxxxxx>
- Date: Mon, 24 Sep 2007 06:53:20 -0400
cambodia wrote:
Hello all experts
I have some problem for update and insert to ms access with asp like
below. str="update hotel set hname='hello',price=12 "
db.execute(str)
i think that the problem only with text data type, then error like
this.no problem with update only with number data type.
Microsoft JET Database Engine error '80040e14'
Syntax error in UPDATE statement.
What you have written there should work with not problem, so I am going to
interpret your use of the word "like" to mean that you are not showing us
the actual code for some reason.
One thing I can tell you is that you will never be ale to diagnose a syntax
problem with a sql statement without seeing the sql statement that is
created by your code. Start by writing it to Response to see what it
actually looks like
Response.Write str
If the problem is not obvious, Open your database in Access, and use the
Access Query Builder to test your statement. If you've built it correctly,
it should run without modification. If you still can't figure out the
problem, show us the actual sql statement.
I suspect you are using dynamic sql to build your sql statement. This can
leave you vulnerable to hackers using sql injection:
http://mvp.unixwiz.net/techtips/sql-injection.html
http://www.sqlsecurity.com/DesktopDefault.aspx?tabid=23
See here for a better, more secure way to execute your queries by using
parameter markers:
http://groups-beta.google.com/group/microsoft.public.inetserver.asp.db/msg/72e36562fee7804e
Personally, I prefer using stored procedures, or saved parameter queries as
they are known in Access:
:
http://www.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=e6lLVvOcDHA.1204%40TK2MSFTNGP12.phx.gbl
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&c2coff=1&selm=eHYxOyvaDHA.4020%40tk2msftngp13.phx.gbl
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
.
- References:
- problem ado with update ms access
- From: cambodia
- problem ado with update ms access
- Prev by Date: problem ado with update ms access
- Next by Date: OLE DB driver with Interbase
- Previous by thread: problem ado with update ms access
- Next by thread: OLE DB driver with Interbase
- Index(es):
Relevant Pages
|
|