Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

string concatenation not working in VB

Status
Not open for further replies.

coca11

Programmer
Mar 20, 2002
7
CA
Hello,
I am still having problems with the string in VB.
When I try to concatenate the sql command that will be send
through ADO, if one of the string variables I am concatenationg using the "&" operator is large (1024),
it does not work,i.e. it seems as though VB stopped concatenating at a certain point. No error messages are reported, except from the Database side since the sql string that got send was incorrect.


Thanks
 
Hi,

it's not vb string concatenation that causes the problems, it is ado. The .commandtext property has a length limit (it might be 1024, I'm not sure).
Solution: break up your command text in several statements or use ado2.6 commandstream property, which allows strings of up to 2Gb.
Sunaj
'The gap between theory and practice is not as wide in theory as it is in practice'
 

HI sunaj
The problem is (partially) in VB. I have a break point and a watch. I see my string (in VB) in the process of concatenating it. There might be a problem with ADO as well. BUt I have to soleve these things one at a time.
Thanks
 
Hi,

The watch function in the VB IDE only shows part of the string. If you want to be sure to see it all print it to the immediate window (debug.print).

Sunaj
'The gap between theory and practice is not as wide in theory as it is in practice'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top