[RESOLVED] string variable truncated to 264 characters
I'm trying to add a long sql statement in a string variable, but it's truncated to 264 characters. Since the sql is not complete then the program crashes.
I've made a testprogram for concattenating long strings, and there it works perfectly. Is this a setting of some kind?
The source is as follows, where lclSelectedList is a global variable holding a list of fieldnames, seperated by a "," and the msgbox results in 264:
Dim lclSql As String
Dim lclQuery As String
On Error GoTo process_error
lclConnected = False
lclSql = ""
lclQuery = ""
lclSql = "select " & lclSelectList & " from " & lclTable & " LEFT JOIN tblDocExtraInfo ON tblDocument.docid = tblDocExtraInfo.docid "
If Len(lclCriteria) > 0 Then
lclSql = lclSql & " where "
lclSql = lclSql & lclCriteria
Else
lclSql = lclSql & " where tbldocument.Docid = " & CStr(lclId)
MsgBox Len(lclSql)
End If
Re: string variable truncated to 264 characters
what is the 265th character?
Re: string variable truncated to 264 characters
The 265 character is a plain character "t", so nothing strange there
Re: string variable truncated to 264 characters
Are you sure it is truncated? Replace your MsgBox line with this & tell us what you get. Open immediate/debug window (Ctrl+G) to see the result:
Code:
Debug.Print "Len="; Len(lclSql): Debug.Print lclSql; "<<"
Re: string variable truncated to 264 characters
Don't know what happend, but after a reboot of my system and a restart of VB it works fine now.
Thanks for the help!