Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default SQL Update problem

    The following SQL statement is resulting in the error after it:

    (pasted from IE window)

    UPDATE Clients SET number = 300, name = 'Ace Lock', address1 = 'add1',
    address2 = 'add2', city = 'city', state = 'pa', zip = '15222' WHERE id = 1;


    Warning: (null)(): Invoke() failed: Exception occurred. Source: Microsoft
    JET Database Engine Description: Syntax error in UPDATE statement. in
    c:\inetpub\wwwroot\kdaclients.php on line 40


    When I take out the number and name fields, it works fine

    UPDATE Clients SET address1 = 'add1', address2 = 'add2', city = 'city',
    state = 'pa', zip = '15222' WHERE id = 1;

    The number field is a number, the rest are text fields. Any input
    appreciated.


    TomD Guest

  2. Similar Questions and Discussions

    1. Update problem
      Hi, I have installed DreamweaverMx6.0, and yesterday I've downloaded DWMX6.1 updater. But I encountered a problem when I installed the updater, ...
    2. inker problem (an update to the 'general problem')
      i have my shockwave 3d project which i know on several machines makes the screen goes nuts, meaning it turns into 'safe mode' - 640*480, 256 colours...
    3. ASP Problem - will not update
      Hi, Hope someone can help. The ASP below correctly gets the data out of the Access DB but when I click update it does not. Anything obviously...
    4. Update to 7.0.1 problem
      Hello, I just want to update my Photoshop 7.0 to 7.0.1. But it doesn't work. During the setup I alwys become an error message: "The Adobe...
    5. apt-get update problem
      Hello. I added entries to my sources.list, but i can't get the related packages : my sources.list -------------------------- deb...
  3. #2

    Default Re: SQL Update problem

    Tom,

    When you use reserved words (e.g.: "name") as table or column names, you
    need to wrap them in square brackets when using them in a Jet SQL statement.
    e.g.:

    UPDATE Clients SET [number] = 300, [name] = 'Ace Lock', address1 = ...

    This allows the Jet SQL engine to recognize the names as identifiers rather
    than mis-use of the reserved words. Of course, an even better approach is
    to not use reserved words as table/column names in the first place...

    HTH,
    Nicole

    "TomD" <dcbcadmgr.no@spam.yahoo.com> wrote in message
    news:uwKThJj8DHA.2404@TK2MSFTNGP11.phx.gbl...
    > The following SQL statement is resulting in the error after it:
    >
    > (pasted from IE window)
    >
    > UPDATE Clients SET number = 300, name = 'Ace Lock', address1 = 'add1',
    > address2 = 'add2', city = 'city', state = 'pa', zip = '15222' WHERE id =
    > 1;
    >
    >
    > Warning: (null)(): Invoke() failed: Exception occurred. Source: Microsoft
    > JET Database Engine Description: Syntax error in UPDATE statement. in
    > c:\inetpub\wwwroot\kdaclients.php on line 40
    >
    >
    > When I take out the number and name fields, it works fine
    >
    > UPDATE Clients SET address1 = 'add1', address2 = 'add2', city = 'city',
    > state = 'pa', zip = '15222' WHERE id = 1;
    >
    > The number field is a number, the rest are text fields. Any input
    > appreciated.
    >
    >

    Nicole Calinoiu Guest

  4. #3

    Default Re: SQL Update problem

    Nicole Calinoiu wrote:
    > Tom,
    >
    > When you use reserved words (e.g.: "name") as table or column names,
    Just to add:
    [url]http://www.aspfaq.com/show.asp?id=2080[/url]


    HTH,
    Bob Barrows
    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.


    Bob Barrows [MVP] Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139