Question about update statement

Results 1 to 2 of 2

Thread: Question about update statement

  1. #1
    Join Date
    Dec 1969

    Default Question about update statement

    Heya guys, me again with another Q :) ... Anyways, I&#039;ve written this thing, and I can&#039;t see whats wrong with it... then again, I&#039;m an idiot and a programming newbie, so maybe someone can help? :) To put it simply, it doesn&#039;t work and I don&#039;t know why... <BR><BR>&#060;%<BR>name=Request.form("name")<BR>it emID=Request.form("itemID")<BR><BR>SQL="UPDATE Products SET Name=&#039;" & Name & "&#039; WHERE itemID=&#039;" & itemID &"&#039;"<BR><BR><BR>set connmodify = server.createobject("ADODB.Connection")<BR>connmod ***.open "yta"<BR>connmodify.execute(SQL)<BR>connmodify.clo se<BR><BR>%&#062;<BR><BR>When executed, I get this error:<BR><BR>"Microsoft OLE DB Provider for ODBC Drivers error &#039;80040e07&#039; <BR><BR>[Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression. <BR><BR>/silent/yta/admin/modifyconfirm.asp, line 10"<BR><BR>I don&#039;t understand this error, I looked at the Microsoft Error database, and it says this error is caused by an incorrect column name? "Name" and "itemID" is just as it is in my database in the "Products" table. To my knowledge it goes "column=value" ? Anyways, thanks again for your help :)

  2. #2
    Join Date
    Dec 1969

    Default RE: Question about update statement

    itemID is more likely a number so you dont need to put quotes around it, i.e:<BR><BR>SQL="UPDATE Products SET Name=&#039;" & Name & "&#039; WHERE itemID=" & itemID

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts