Results 1 to 4 of 4

Thread: SQL: UPDATE command problems

  1. #1
    Guest
    Could anyone tell me if there is any limit to the number of the fields that UPDATE command can update? I have a problem where the code below faild with the run time error 3144 (Syntax error in UPDATE statement), whereas if I take some of the fields out, it works.


    SQLString = "UPDATE StationDet2 " _
    & "SET NoRegularA = " & Check1 & ", " _
    & "NoRegularB = " & Check2 & ", " _
    & "NoRegularC = " & Check3 & ", " _
    & "SuperS = " & Distributori(0) & ", " _
    & "SuperD = " & Distributori(1) & ", " _
    & "SuperM = " & Distributori(2) & ", " _
    & "SSpbS = " & Distributori(3) & ", " _
    & "SSpbD = " & Distributori(4) & ", " _
    & "SSpbM = " & Distributori(5) & ", " _
    & "GasolioS = " & Distributori(6) & ", " _
    & "GasolioD = " & Distributori(7) & ", " _
    & "GasolioM = " & Distributori(8) & ", " _
    & "GPLS = " & Distributori(9) & ", " _
    & "GPLD = " & Distributori(10) & ", " _
    & "MetanoS = " & Distributori(11) & ", " _
    & "MetanoD = " & Distributori(12) & " " _
    & "WHERE Station_ID = " & wkStationID(ListChoice) & ";"

    db.Execute SQLString


  2. #2
    Guest
    Check the fields that you removed. Could any of those be an empty string? That would give a syntax error.

    The number of columns updated (as in your query )should as such not give any problems.

  3. #3
    Fanatic Member
    Join Date
    Aug 2000
    Posts
    617

    hmm

    Are there more than 255 chars being stuffed in SQLSTRING variable?


  4. #4
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105
    There is a limit to the string size of the sql statement. You can, of course, get around this by executing multiple updates.

Posting Permissions

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



Click Here to Expand Forum to Full Width