Results 1 to 15 of 15

Thread: aaaah I'm going insane ![Resolved]

  1. #1

    Thread Starter
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083

    Talking aaaah I'm going insane ![Resolved]

    What's wrong with this sql statement ??
    VB Code:
    1. Dim Updater As String = "UPDATE " & MyTable & "SET C_URL='" & _
    2. str1 & "'" & " C_category='" & str2 & "'" & " C_language='" & str3 _
    3. & "'" & " C_USERNAME='" & str4 & "'" & " C_PASSWORD='" & str5 _
    4. & "'" & " C_TIME='" & str6 & "'" & " C_DATE='" & str7 & "'" & " _
    5. C_RATING='" & str8 & "'" & " C_COMMENT='" & str9 & "'" & " _
    6.  
    7. WHERE C_URL='" & str1 & "'"
    Last edited by Pirate; Apr 9th, 2003 at 07:00 PM.

  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    You need to put a space before SET for one.

  3. #3
    Addicted Member
    Join Date
    Aug 1999
    Posts
    164
    "UPDATE " & MyTable & "SET
    Put a space before SET and after MyTable
    -Shurijo

  4. #4

    Thread Starter
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Actually there's a space but I forgot to include it here . Sorry to tell you , it won't work either .

  5. #5

    Thread Starter
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    I should've told the error it throws : "Missing Operator" . It looks fine but don't know that's wrong in here .

  6. #6
    Addicted Member
    Join Date
    Aug 1999
    Posts
    164
    You don't have any commas in there.

    It should be like Update myTable SET fieldA = valueA, fieldB = valueB, fieldC = valueC where fieldD = valudD
    -Shurijo

  7. #7

    Thread Starter
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    No need to have commas in SQL Str.I'm sure

  8. #8
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    In a SET statement that sets multiple values you do.

  9. #9

    Thread Starter
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    do what ? Umm ? What're you talking about!!!!!

  10. #10

    Thread Starter
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    btw , Don't you think field names are sensitive ??

  11. #11
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    Dim Updater As String = "UPDATE " & MyTable & " SET C_URL='" & _
    str1 & "'," & " C_category='" & str2 & "'," & " C_language='" & str3 _
    & "'," & " C_USERNAME='" & str4 & "'," & " C_PASSWORD='" & str5 _
    & "'," & " C_TIME='" & str6 & "'," & " C_DATE='" & str7 & "'," & " _
    C_RATING='" & str8 & "'," & " C_COMMENT='" & str9 & "'" & " _

    WHERE C_URL='" & str1 & "'"

  12. #12

    Thread Starter
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    hellswraith what did you add . No more errors but it isn't updating my db !

  13. #13

    Thread Starter
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    I c , so the magic in commas .How come ? . I remember I've tried like that but without commas .

  14. #14

    Thread Starter
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Thanks hellswraith . Now everything is fixed !

  15. #15

    Thread Starter
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Originally posted by Shurijo
    You don't have any commas in there.

    It should be like Update myTable SET fieldA = valueA, fieldB = valueB, fieldC = valueC where fieldD = valudD
    That's right .thanks

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