line continuation character
-
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....
-
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....
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 )
-
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....
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...
-
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....
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, AllenAllen Smith Software Engineer ComponentOne LLC www.componentone.com
-
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....
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