String datatype - Access 2000 adp

  • Thread starter Thread starter Burglar
  • Start date Start date
B

Burglar

All,

I have an Access97 application that I have converted to
Access2000 and now want to convert it to adp. I can get
almost everything to work fine with one exception. When I
try to concantenate character data to a variable dimmed as
type string, once I reach the 255 character mark, no more
data is concantenated. The same exact code works in
Access2000 MDB but my strings get cut off. Any ideas in
this matter would be greatly appreciated.
 
You mean inside VBA code or SQL statements?
Maybe an exemple would help as there as some possibilities here.

S. L.
 
Sorry, inside the VBA code. Here is the function that I
am using to build a comma seperated list of values from a
listbox control on my form. I use the comma seperated
list as a parameter to many different stored procs.
Anyway, here is the function.

Public Function BuildListOfSelection(ctl As Control,
StringList As String, col As Integer, Optional ListCount
As Integer)
' Initialize string variable to blank
StringList = ""
' Store number of selected items in an integer
variable for later use
ListCount = ctl.ItemsSelected.Count
' Walk through all selected items in passed control
For Each varItm In ctl.ItemsSelected
' Concantenate each value to string variable
StringList = StringList & ctl.Column(0, varItm)
& ","
Next varItm
' Remove the trailing comma after last
concantenation
If StringList <> "" Then StringList = Mid
(StringList, 1, Len(StringList) - 1)
End Function


After "StringList" gets to 255 characters long, no more
data is concantenated.

Don Ellis
IT Director
Aria Communications
 
As far as I can tell, this code work perfectly well under Access 2002, both
with MDB and ADP files.

For Access 2000, I cannot tell you.

Where are you testing for the length of the resulting string?

S. L.
 
Actually, I am not testing the length at anytime except in
debugging mode with the watch window when I can see that
when the string value is 255 characters long, no more data
can be concantenated. This is a very strange problem...is
it possible that I don't have an appropriate reference?
Here are the references that I have thus far in there
priority order.

VB for Applications
MS Access 9.0 Object Library
MS ActiveX Data Objects 2.7 Library
OLE Automation
ACG PDF and Mail Library
MS Outlook 9.0 Object Library
MS Windows Common Controls 6.0

Although, these are the same references that I have in the
MDB version and it works fine? Did I just get some bad
crack or is this really an issue? I do appreciate your
responses thus far.

Don
 
As far as I know, the watch window can only show you the first 255
caracteres.

Maybe something like MsgBox (Len (StringList)) will put some light on this.

S. L.
 
Thank you, thank you, thank you! That was the case.
Since I know that now and was able to determine that in
fact the variable was holding all of my data, I was able
to determine what the real problem with the app was. Once
again, thanks.


Don
 
Back
Top