Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. line continuation character

line continuation character

Scheduled Pinned Locked Moved Visual Basic
helpdatabasetutorialannouncement
5 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MissionSuccess
    wrote on last edited by
    #1

    sorry sir but i cannot find any forum for vb6.0 here... plz suggest some remedy for my problem... how to use the line continuation character in vb6.0 when u r going to write a update query in a string which goes more than 1024 characters(max allowed.) ex. strsql="update table set fld1='" & txt1 & "', _ fld2='" & txt2 & "' where id='" & myId & "'" this gives me the error "end of statement expected...." plz give me the exact syntax....

    C C C D 4 Replies Last reply
    0
    • M MissionSuccess

      sorry sir but i cannot find any forum for vb6.0 here... plz suggest some remedy for my problem... how to use the line continuation character in vb6.0 when u r going to write a update query in a string which goes more than 1024 characters(max allowed.) ex. strsql="update table set fld1='" & txt1 & "', _ fld2='" & txt2 & "' where id='" & myId & "'" this gives me the error "end of statement expected...." plz give me the exact syntax....

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      I think the _ needs to be the last character. You can't just put & at the end ? Wow - VB6 really sucks...

      Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

      1 Reply Last reply
      0
      • M MissionSuccess

        sorry sir but i cannot find any forum for vb6.0 here... plz suggest some remedy for my problem... how to use the line continuation character in vb6.0 when u r going to write a update query in a string which goes more than 1024 characters(max allowed.) ex. strsql="update table set fld1='" & txt1 & "', _ fld2='" & txt2 & "' where id='" & myId & "'" this gives me the error "end of statement expected...." plz give me the exact syntax....

        C Offline
        C Offline
        ChandraRam
        wrote on last edited by
        #3

        MissionSuccess wrote:

        how to use the line continuation character in vb6.0 when u r going to write a update query in a string which goes more than 1024 characters(max allowed.) ex. strsql="update table set fld1='" & txt1 & "', _ fld2='" & txt2 & "' where id='" & myId & "'"

        Probably better to split into two Update queries...

        1 Reply Last reply
        0
        • M MissionSuccess

          sorry sir but i cannot find any forum for vb6.0 here... plz suggest some remedy for my problem... how to use the line continuation character in vb6.0 when u r going to write a update query in a string which goes more than 1024 characters(max allowed.) ex. strsql="update table set fld1='" & txt1 & "', _ fld2='" & txt2 & "' where id='" & myId & "'" this gives me the error "end of statement expected...." plz give me the exact syntax....

          C Offline
          C Offline
          C1AllenS
          wrote on last edited by
          #4

          Hello, You need to use the following code syntax. strsql = "update table set fld1='" & txt1 & _ "' fld2='" & txt2 & "' where id='" & myId & "'" I hope this helps. Regards, Allen

          Allen Smith Software Engineer ComponentOne LLC www.componentone.com

          1 Reply Last reply
          0
          • M MissionSuccess

            sorry sir but i cannot find any forum for vb6.0 here... plz suggest some remedy for my problem... how to use the line continuation character in vb6.0 when u r going to write a update query in a string which goes more than 1024 characters(max allowed.) ex. strsql="update table set fld1='" & txt1 & "', _ fld2='" & txt2 & "' where id='" & myId & "'" this gives me the error "end of statement expected...." plz give me the exact syntax....

            D Offline
            D Offline
            Dave Kreskowiak
            wrote on last edited by
            #5

            You might want to read this[^] article and convert this to a parameterized query. Any user can screw this statement up just by entering a "'" character into one of your textboxes that you blindly throw into your SQL statement.

            A guide to posting questions on CodeProject[^]
            Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                 2006, 2007

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups