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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB6 String Length Limitation?

Status
Not open for further replies.

Bratfry

IS-IT--Management
Apr 10, 2001
48
0
0
US

I am building a SQL string using the following method.

A = string data (Lots of string data)
B = lots more string data
C = lots more string data

Then

SQLcommand = A & B & C

When I display SQL, part of the C string is not displayed. If I delete data in the A or B string then more of C is displayed. This indicates to me that string variable in VB6 has a length, which makes sense but I can't find out what that length limitation is.

So I guess the question is how do I make a really long string to use as an SQL command.

I have run out of ideas and perhaps knowledge.

Thanks.

Gary
 
>> When I display SQL

What are you doing to display the string? If you are using a text box on a form, then you are limited to the size. (I think 32k). If you debug.print it, there is also a limit. You could put a rich text box control on the form and put the string in there. That has a much larger limit so you should be able to see the whole thing.

My point, though... you are probably running in to a display issue instead of a string limit issue. I've had strings with millions of characters without any problem.

By the way... what type of database are you using? Microsoft SQL server, Access, Oracle, etc....

-George

"the screen with the little boxes in the window." - Moron
 

I used to use a MsgBox to display my SQLs, but now I use Debug.Print

But you can not go wrong with:
Code:
Open App.Path & "\MySQL.txt" For Output As #1
Print #1, A & B & C
Close #1
I don't think there is a limit of how large a text file could be.

Have fun.

---- Andy
 
It is unlikely that you are hitting the VB string limit, which is (theoretically) 2GB
 
I was using msgbox and concentrating so much on the string length I didn’t even think about a limitation on the display.

Obviously that’s what it was. Actually now I’m using a log file output I had build in the program and I can see the entire SQL command.

It is a Oracle SQL command and its not 2 GB long, thank goodness :)

Thanks all for pointing me in the right direction, I needed that on a Friday.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top