473,498 Members | 1,911 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Does String Datatype in VBA hold more than 255 characters?

9 New Member
I'm trying to use a SQL statement that is longer than 255 characters in Access VBA 2007. When I look at the local variable it cuts the rest of the string variable off. Code I used was this in VBA.

dim myStr as String

myStr = "String Holds more than 255 characters"

I've tried using a couple of differnt strings to see if my syntax of the string in the variable was wrong but it still cuts off at 255 characters.

Thank you,
Devo
Nov 30 '09 #1
7 8593
ChipR
1,287 Recognized Expert Top Contributor
How are you examining the contents of the string?
Nov 30 '09 #2
sirdevo
9 New Member
Creating a breakpoint and then checking the locals screen.

Devo
Nov 30 '09 #3
ChipR
1,287 Recognized Expert Top Contributor
It must be a limitation of the editor. Here's a simple test:
After you declare your long string,
Expand|Select|Wrap|Line Numbers
  1. MsgBox Len(myStr)
Nov 30 '09 #4
ChipR
1,287 Recognized Expert Top Contributor
Also,
Expand|Select|Wrap|Line Numbers
  1. Debug.Print myStr
Nov 30 '09 #5
sirdevo
9 New Member
Thanks Chip,

The whole string does come through in the msgbox, so it must be a limitation of the editor. I was wanting to check it since it was an UPDATE statement and would have hated to change the whole table with a bad statement. It showed the whole message when I put the String into a messagebox.

Thank you again,
Devo
Nov 30 '09 #6
missinglinq
3,532 Recognized Expert Specialist
Straight from the (Access Help) horse's mouth:

String Data Type

There are two kinds of strings: variable-length and fixed-length strings.

A variable-length string can contain up to approximately 2 billion (2^31) characters.

A fixed-length string can contain 1 to approximately 64K (2^16) characters.

Welcome to Bytes!

Linq ;0)>
Nov 30 '09 #7
keirnus
48 New Member
Just what I was looking for.

missinglinq never miss :)

kudos! (^_^)/
Sep 6 '10 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

1
1906
by: carl bloc | last post by:
Have this much done but need help with this bit of code: allow user to modify existing draw data. I think I need a counter to give week numbers so the user can select a week number rather than a...
34
759
by: Sunner Sun | last post by:
Hi! I have looked through the FAQ but found nothing about it. :-) It seems that this kind of macro is platform dependent, doesn't it? Thank you. Sunner Sun
6
5745
by: alternativa | last post by:
Hi, I have problem with the following function - it was intended to ask a user for a 4-digits number: double ask_for_number (void) { char *notint; char s2; double entered_number;
87
5018
by: Robert Seacord | last post by:
The SEI has published CMU/SEI-2006-TR-006 "Specifications for Managed Strings" and released a "proof-of-concept" implementation of the managed string library. The specification, source code for...
8
3085
by: gthorpe | last post by:
Hi, I have a question about string constants. I compile the following program: #include <stdio.h> #include <string.h> int main(void) { char str1 = "\007";
5
5872
by: Henrik | last post by:
The problem is (using MS Access 2003) I am unable to retrieve long strings (255 chars) from calculated fields through a recordset. The data takes the trip in three phases: 1. A custom public...
14
2139
by: Aman JIANG | last post by:
hi i need a fast way to do lots of conversion that between string and numerical value(integer, float, double...), and boost::lexical_cast is useless, because it runs for a long time, (about 60...
25
8292
by: Bala2508 | last post by:
Hi, I have a C++ application that extensively uses std::string and std::ostringstream in somewhat similar manner as below std::string msgHeader; msgHeader = "<"; msgHeader += a; msgHeader...
5
3620
by: shashidhar.yarlagadda | last post by:
hi, hey! i am writing an XML Schema Defination where i got a sistutation in such way that i need to defina a tag that should hold binary data (ASCII data). How can i handle this sistutation? I...
0
7125
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7002
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7203
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6885
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
4588
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3093
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3081
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1417
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
290
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.