TextBox Character Limit? (MS Access 2002 .adp connected to SQL)

H

HumanJHawkins

I have an SQL DB (MS SQL Server 2000 SP 3) with a varchar(1024) field i
it.

I have made an .adp interface for this data. I am trying to allow user
to enter data in _other_ fields and use VB to concatenate other field
into this 1024 char long field. However, whenever the concatenatio
exceeds 255 characters it fails. Oddly, instead of truncating it a
255, it only shows the remaining text after the first 255 characters.

So, if the text is under 255, it works perfectly. But if I go one wor
over, the only thing in the text box is that one word that went over.

I am using a standard textbox from the Access tool pallette. The synta
is very simple, as in (where I have 3 text boxes, each named "Combined"
"Source1", and "Source2"):


Code
-------------------
Function CombineFields()
Combined = Source1 & Source2
End Functio
-------------------


I think the chopping off happens between VB and the text box after I a
done with it... In the debugger, I can see that the strings are fin
when the function is done with them. And, I know the text box can hol
more, because I can type more than 255 chars into it just fine.

Any tips on how to either make this work, or make another solutio
would be much appreciated!

Thanks
 
H

HumanJHawkins

HumanJHawkins said:
I have an SQL DB (MS SQL Server 2000 SP 3) with a varchar(1024) field in
it.

I have made an .adp interface for this data. I am trying to allow users
to enter data in _other_ fields and use VB to concatenate other fields
into this 1024 char long field. However, whenever the concatenation
exceeds 255 characters it fails. Oddly, instead of truncating it at
255, it only shows the remaining text after the first 255 characters.

So, if the text is under 255, it works perfectly. But if I go one word
over, the only thing in the text box is that one word that went over.
<CUT>

The answer is that Access will not send more than 255 chars to a varchar,
even if it can hold more. However, changing the varchar to a "Text" data
type works around this bug in Access.

Cheers!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top