Results 1 to 5 of 5
  1. #1
    DCross is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jun 2015
    Posts
    3

    VBA SQL query gets truncated

    Hello.


    I am trying to add data to an existing, populated, Access table from a VBA data array. I only want to add the record to the Access table if it does not already exist in the table. I determine this using an SQL select command as follows:

    sql_snippet.txt

    My issue is that the "text" variable can be up to 2000characters and appears to be truncated in the "strSql" string (note: strSql didn't make it into the code snippet but it is dimensioned as a String).
    Is there a limit to the size of a pattern match string in Access? If so, can it be increased?

    Also, the TRTEXT field in the table which "text" is meant to search in a memo type field.

    Thanks

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Exactly why I avoid memo type fields. Review http://allenbrowne.com/ser-63.html
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    DCross is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jun 2015
    Posts
    3
    Thanks for the quick response June7.
    My query doesn't seem to be an exact match for the items described in http://allenbrowne.com/ser-63.html but I think I can see why it is getting truncated.

    So is there any way to determine if a record in my access table is an exact match for my data array when one of the fields I have to compare is over 2000 characters?

    Thanks again.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Never had to so don't know.

    Seem to remember reading something about breaking up the string into smaller pieces and search each piece. Problem with that is the string to match might be split between pieces.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    DCross is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jun 2015
    Posts
    3
    OK.
    Thanks for the information.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Expand reports truncated field
    By Thompyt in forum Programming
    Replies: 1
    Last Post: 06-01-2015, 08:27 AM
  2. Replies: 1
    Last Post: 02-25-2015, 04:40 PM
  3. Truncated when exported to excel
    By memaxt in forum Import/Export Data
    Replies: 1
    Last Post: 09-05-2014, 12:58 AM
  4. Replies: 1
    Last Post: 02-22-2013, 09:39 PM
  5. Truncated field in my report
    By cvolkers in forum Reports
    Replies: 1
    Last Post: 03-08-2011, 12:11 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums