Re: problem ado with update ms access



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"


.



Relevant Pages

  • Re: SQL Query
    ... Therefore, God exists. ... A SQL statement begins with "SELECT," ... This means that you are specifying the "Shipping_Group" column of the ... It also means that the "Shipping_Group" column is of a text data type. ...
    (microsoft.public.frontpage.programming)
  • Re: SQL Query
    ... A SQL statement begins with "SELECT," ... alphabetical order. ... This means that you are specifying the "Shipping_Group" column of the ... It also means that the "Shipping_Group" column is of a text data type. ...
    (microsoft.public.frontpage.programming)
  • Possible Oracle 9.2.0.7 performance issue with DBD::Oracles column_info()
    ... My coworkers and I have a question regarding the SQL statement that DBD::Oracle's column_infofunction executes. ... We depend upon column_infoto discover the data type of a large object column is so we can bind it properly. ... While this worked great for us in the past, when we upgraded to Oracle 9.2.0.7 we noticed significant performance drops whenever this method was called. ... A data load test with dbi profiler running showed that column_info's SQL accounts for 78.33% of all dbi calls made during the test. ...
    (perl.dbi.users)
  • Re: Insert Into Statement Help
    ... The only way to debug a sql statement is to look at it. ... more secure way to execute your queries by using ... Personally, i prefer using stored procedures, or saved parameter queries as ... This email account is my spam trap so I ...
    (microsoft.public.inetserver.asp.db)
  • Re: Type mismatch
    ... Thanks for the input, question, can the expression of the DMin contain more ... > The third argument of the DateAdd function must be a date data type. ... > DateAdd function does not accept an SQL statement in any of its arguments. ...
    (microsoft.public.access.formscoding)