#1
  1. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Mar 2008
    Posts
    2
    Rep Power
    0

    How to resolve Error: -2147217900?


    I was trying to update the DB with this error code -2147217900

    The error as following:
    ==================
    Description: Operator Expression Error
    Help context: 5003000
    Help file:
    Native error: -524553244
    Error number: -2147217900
    Error source: Microsoft JET Database Engine
    SQL state: 3075


    Can anybody help me?

    Original Code:
    ==========
    [code]
    <html>
    <head>
    <title>Submit News to DataBase</title>
    </head>
    <body>
    <h2>Submit News to Database</h2>

    <%
    set conn=Server.CreateObject("ADODB.Connection")
    conn.provider="Microsoft.Jet.OLEDB.4.0"
    conn.open(server.mappath("/adm/test.mdb"))

    if Request.form("action")="Save" then
    id=Request.Form("id")
    sql="UPDATE tableindex SET "
    sql=sql & "data='" & Request.Form("data") & "',"
    sql=sql & "FILE='" & Request.Form("FILE") & "'"
    sql=sql & " WHERE tableindex.[id]=" & id

    'response.Write("<br><br>" & id)
    'response.Write("sql : " & sql & "<br>")
    'response.End()
    on error resume next

    conn.Execute sql
    if err<>0 then
    Response.Write("Error:&nbsp;" & err)
    Response.Write("<br>You do not have permission to update this database!")
    else
    Response.Write("Record number " & id & " was updated.")
    end if
    end if

    conn.close%>

    <%
    for each objErr in conn.Errors
    response.write("<p>")
    response.write("Description: ")
    response.write(objErr.Description & "<br />")
    response.write("Help context: ")
    response.write(objErr.HelpContext & "<br />")
    response.write("Help file: ")
    response.write(objErr.HelpFile & "<br />")
    response.write("Native error: ")
    response.write(objErr.NativeError & "<br />")
    response.write("Error number: ")
    response.write(objErr.Number & "<br />")
    response.write("Error source: ")
    response.write(objErr.Source & "<br />")
    response.write("SQL state: ")
    response.write(objErr.SQLState & "<br />")
    response.write("</p>")
    next
    %>


    </body>
    </html>
    [code]
  2. #2
  3. Contributing User
    ASP Genius (4000 - 4499 posts)

    Join Date
    Jun 2004
    Location
    Somewhere only we know...
    Posts
    4,230
    Rep Power
    1494
    What do you get if you uncomment these lines:-
    Code:
    response.Write("<br><br>" & id)
    response.Write("sql : " & sql & "<br>")
    response.End()
    My ASP.NET Blog
    I'd rather have a full bottle in front of me, than a full frontal lobotomy...
  4. #3
  5. Contributing User
    ASP High Scholar (3500 - 3999 posts)

    Join Date
    Mar 2006
    Location
    South Wales
    Posts
    3,674
    Rep Power
    2043
    I think data and file are reserved words, what happens if you surround them with square brackets:
    Code:
    sql="UPDATE tableindex SET " & _
    "[data]='" & Request.Form("data") & "', " & _
    "[FILE]='" & Request.Form("FILE") & "' " & _
    "WHERE tableindex.[id]=" & id
  6. #4
  7. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Mar 2008
    Posts
    2
    Rep Power
    0
    Thanks budd, i found the problem.
    it is not because of the codings, but it is because of the sql server doesnt accept special characters & the html tags in "data" field. Thanks for the suggestion.



    Originally Posted by sync_or_swim
    I think data and file are reserved words, what happens if you surround them with square brackets:
    Code:
    sql="UPDATE tableindex SET " & _
    "[data]='" & Request.Form("data") & "', " & _
    "[FILE]='" & Request.Form("FILE") & "' " & _
    "WHERE tableindex.[id]=" & id
  8. #5
  9. Contributing User
    ASP High Scholar (3500 - 3999 posts)

    Join Date
    Mar 2006
    Location
    South Wales
    Posts
    3,674
    Rep Power
    2043
    Glad you solved your problem!!! What is the field "data" defined as? I may be mistaken, but I think that you should be able to store HTML tags if you use a datatype of NText.

Similar Threads

  1. Navistar, Ford to try to resolve engine dispute (Reuters)
    By RSS_News_User in forum Business News
    Replies: 0
    Last Post: March 8th, 2007, 06:04 PM
  2. Senators unlikely to resolve yuan dispute: paper (Reuters)
    By RSS_News_User in forum Business News
    Replies: 0
    Last Post: March 22nd, 2006, 10:04 PM
  3. Microsoft, IBM Resolve Antitrust Issues (NewsFactor)
    By RSS_News_User in forum Technology News
    Replies: 0
    Last Post: July 1st, 2005, 02:02 PM
  4. WTO must act to resolve impasse -APEC (Reuters)
    By RSS_News_User in forum Business News
    Replies: 0
    Last Post: June 3rd, 2005, 01:01 AM
  5. Replies: 0
    Last Post: March 16th, 2005, 09:00 AM

IMN logo majestic logo threadwatch logo seochat tools logo