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

Size limit on Strings? 2

Status
Not open for further replies.

benlinkknilneb

Programmer
May 16, 2002
590
US
Hey all,

I am building an application in Access and in one area, I'm using VBA to build an SQL string. My problem is that it cuts off at ~250 characters. My statement is pretty involved, so it's long. Like, maybe twice that long. An app that I wrote a long time ago didn't have this problem, to my recollection. Can anyone help?

Ben

There's no place like 127.0.0.1.
 
are you sure you're using a STRING not storing it in a table or something?

the STRING datatype has like 32000 characters or something like that...

--------------------
Procrastinate Now!
 
yeah.

Dim SQLStr As String
SQLStr = "SELECT ItemID, LocationName...."

It cut off at 251 characters. I have no idea why.

Ben

There's no place like 127.0.0.1.
 
how are you determining they are cutting off at the 251 point?

msgbox?

--------------------
Procrastinate Now!
 
32K characters, hmm - what about approx 2 billion characters for variable lengt string ;-)

Is it "wrapping" the thing on more than one line? If so, check out this thread705-833660 ;-)

Roy-Vidar
 
Crowley:
Copy-pasted the "Watch" value into Word and ran statistics.

Roy:
No, it's not quite that long. The line runs properly, all the way to the end of the function, actually... but when I look at it in the "Watch", it's been cut off.

Ben

There's no place like 127.0.0.1.
 
Do

[tt]debug.print sqlstr[/tt]

What is the result (ctrl+g)?

Roy-Vidar
 
lol...

that'll be the Watch copy and paste that's cutting it off, the string itself is all there...

roy:
2 billion, wow, that's a pretty complicated select statement for sure...

--------------------
Procrastinate Now!
 
Has VBA always done that? I've copied from "Watch" lots of times before and never had that happen... and I have written some pretty large SQL statements. 'Course a lot of them were done in VB.NET... maybe that's the reason. Weird, but ok. Thanks, y'all.

Ben

There's no place like 127.0.0.1.
 
see what I mean...

--------------------
Procrastinate Now!
 
not sure if it's vba or the copy and paste method you're using...

--------------------
Procrastinate Now!
 
Crowley,

It is VBA. The "watch" window allows you to view the contents without copying, and they're cut off in there. Once I saw that, I copied what little I had to Word to see how long it was... but the data was missing from the Watch screen.

Ben

There's no place like 127.0.0.1.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top