Re: Problem with large amount of characters in a VBA variant



nartla <bruno.barral@xxxxxxxxxx> wrote in
news:0a098301-faf3-4ef8-be89-4e1f0dc0c2c4
@u10g2000prn.googlegroups.co
m:


Hello,

I work on an app developped with Access/VBA and communicating with
a SQL Server database via ODBC.

My problem is that I have to manage a big string which can be 0 to
1024 characters long. The string is correctly stored in the Access
and SQL Server tables (Memo field for Access, and varchar(1024)
for SQL Server).

I also need to write this string in an Excel report created by the
application. For this purpose, I store the huge string in a
variant VBA variable, but when looking at the variant with the
debugger, I find that it has got only 255 characters (when the
string is 1024 characters long). In the Excel report, I also get
only the 255 first chars.

Is this a normal behaviour ? I searched the internet but I didn't
find information about the max string length that can be stored in
a variant in VBA ?

Thank you for your help.

See the Microsoft Knowledgebase article at
http://support.microsoft.com/kb/208801


--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

.



Relevant Pages

  • Re: Replace space in text file
    ... In four of the above cases you have specified which type of variable you want VB to create (Integer, Long, String or whatever). ... in the case of vChars you have not specified the required variable type and VB will therefore create it as a Variant. ... For example, if vChars was an Integer then VB would read two bytes from the file, and if it was a Long it would read four bytes, and if it was a standard variable length String which currently contained nine characters then it would read nine characters from the file and if it was a String that currently contained just one character then it would read one character from the file. ...
    (microsoft.public.vb.general.discussion)
  • Re: Replace space in text file
    ... The reason I made vChar a variant (by simply not assigning any type to it to ... Dim sMarket As String ... case of vChars you have not specified the required variable type and VB ... standard variable length String which currently contained nine characters ...
    (microsoft.public.vb.general.discussion)
  • Re: String field length truncated to 255
    ... ado connecting to Microsoft sql server 2000. ... > trying to insert about 825 character string into the new record. ... > characters of data in Sql Query Analysis as I scroll the column to the ... Question is there a good tool to look at the sql server and see what is ...
    (borland.public.delphi.database.ado)
  • Re: spoofing question
    ... > I am not at liberty to do this as I do not have SQL Server. ... The GUID suggestion was merely one way of creating an "unguessable" session ... could randomly generate a string of digits and check your db for uniqueness. ... characters, you would need 38.53 characters to cover the same range of ...
    (microsoft.public.inetserver.asp.general)
  • Re: Linking tables access - sql server 2005
    ... Another advantage of this method is that you don't need an ODBC setting on the local computer, ... Create a linked table to SQL Server without using a DSN ... Name of the table that you are linking to on the SQL Server database ... Function AttachDSNLessTable(stLocalTableName As String, stRemoteTableName As String, stServer As String, stDatabase As String, Optional stUsername As ...
    (microsoft.public.access.adp.sqlserver)

Loading