SQL error,

Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: SQL error,

  1. #1
    really stuck Guest

    Default SQL error,

    Hi,<BR><BR>I&#039;m getting following error.<BR><BR>Microsoft OLE DB Provider for ODBC Drivers error &#039;80040e14&#039; <BR>[Microsoft][ODBC Microsoft Access Driver] Extra ) in query expression &#039;(((maintable.[assetid])=))&#039;. <BR><BR>/itstaff/updateasset.asp, line 30<BR><BR>Updateasset.asp is run when i change values in editasset.asp.<BR>I haven&#039;t a notion whats causing the error. Here&#039;s some of my code. Can someone please help, i really need this to work. Line 30 is the last line of my code.<BR><BR>conn.Open<BR>if Request.form("action")="Submit Changes" then<BR> assetid=Request.Form("assetid")<BR> sql="UPDATE maintable set manuf =&#039;" & Request.Form("manuf") _<BR> & "&#039;,modelf =&#039;" & Request.Form("modelf") _<BR> & "&#039;,usercode1f =&#039;" & Request.Form("usercode1f") _<BR> & "&#039;,usercode2f =&#039;" & Request.Form("usercode2f") _<BR> & "&#039;,serialnumf =&#039;" & Request.Form("serialnumf") _<BR> & "&#039;,typef =&#039;" & Request.Form("typef") _<BR> & "&#039;,name1f =&#039;" & Request.Form("name1f") _<BR> & "&#039;,name2f =&#039;" & Request.Form("name2f") _<BR> & "&#039;,ownedleasedf =&#039;" & Request.Form("ownedleasedf") _<BR> & "&#039;,dateadded =&#039;" & now() _<BR> & "&#039; WHERE (((maintable.[assetid])=" & assetid & "))"<BR> conn.Execute sql, Recordsaffected<BR><BR> <BR>Thanks

  2. #2
    aru Guest

    Default RE: SQL error,

    did you check whether your single quotes are enclosed properly within double quotes? <BR><BR>

  3. #3
    JG Guest

    Default RE: SQL error,

    if assetid is a numeric value then you need to convert it...<BR><BR>CInt(Request.Form("assetid"))...<BR>< BR>if assetid is not numeric or "" or null it will produce a runntime error, so you should check it before you convert it...<BR><BR>if isnumeric(Request.Form("assetid")) then...<BR><BR>FYI - any value returned from a request.form or request.querystring is a variant...so all numbers must be converted to their appropriate types<BR><BR>hope this helps<BR>

  4. #4
    Join Date
    Dec 1969

    Default RE: SQL error,

    Looking at the error message, it seems like the variable assetid is undefined.<BR>

  5. #5
    really stuck Guest

    Default Can't spot it

    Have i inserted my qoutes incorrectly.<BR><BR>I can&#039;t spot it, can you?<BR><BR>Thanks

  6. #6
    really stuck Guest

    Default RE: SQL error,

    Thanks,<BR><BR>assetid is indeed a numeric value but how would a convert it in my code

  7. #7
    JG Guest

    Default RE: SQL error,

    lngAssetID = CLng(Request.Form("assetid"))

  8. #8
    really stuck Guest


    Hi,<BR><BR>All errors are gone, but when i submit it says Record no 0 was updated, instead of record no "what ever no selected".<BR><BR>Any idea?

  9. #9
    JG Guest


    can you post the code that returns this message?

  10. #10
    really stuck Guest


    Can i send it to you by email. The code is really long and i think another file that this file is taking data from may be the problem.<BR><BR>My email address is <BR>9730249@student.ul.ie.<BR><BR>Thanks for your help.

Posting Permissions

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