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 data type limit

Status
Not open for further replies.

garybug

Programmer
Jul 27, 2003
42
GB
Am I correct in thinking that the String data type will only hold 255 characters? I've found this as I'm trying to build a large WHERE clause in VBA, which will then serve as the Rowsource for a Listbox. According to the Access Help, it can hold up to 2 billion charcters, but web page it is only 255. Some clarification would be helpful!!

Ta

Gary
 
A text (string) field in a table can hold only up to 255 characters, but a variable length string variable can hold up to 2 billion...

As long as you don't declare your string with a fixed length (which can still hold about 64K) you should be fine...



--------------------------------------
"For a successful technology, reality must take precedence over public relations, for Nature cannot be fooled." - Richard P. Feynman
 
Hi Hare

Thanks, but this string is not populating a control, it's purely holding a SQL WHERE clause in VBA, which is then assigned to a LISTBOX Rowsorce rpoperty, then the listbox is requeried.
 
Then it may be a limitation on the size of a Listbox Rowsource variable...

Could you try assigning your big string to a querydef object, and then using that querydef object as the rowsource?



--------------------------------------
"For a successful technology, reality must take precedence over public relations, for Nature cannot be fooled." - Richard P. Feynman
 
My fault... But it does raise another question!

It turns out it wasn't the string, but the Collection I was using to hold the results of my search - as it will only hold 254 items(!). I'm going to look into a variable sized array or something.

Thanks for replying though..

G
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top