ACC2000: Exported Query Expression Truncated at 255 Characters (207668)
The information in this article applies to:
This article was previously published under Q207668 Moderate: Requires basic macro, coding, and interoperability skills.
SYMPTOMS
When you export a query that contains an expression that results in more
than 255 characters, the expression is truncated in the exported file.
CAUSE
Microsoft Access evaluates the expression as a Text field, and Text fields
have a maximum length of 255 characters. When you export the query,
Microsoft Access truncates anything after the 255th character.
RESOLUTION
Use an append query to append the data to a table that has a Memo field,
and then export the table. The following example creates a table to store
the results of a query expression that exceeds 255 characters:
- Start Microsoft Access and open the sample database Northwind.mdb.
- Create the following table in Design view:
Table: EmpNotes
--------------------
Field Name: EmpName
Data Type: Text
Field Name: Comments
Data Type: Memo
- Save the EmpNotes table and close it. You do not need to create a primary key.
- Create the following query in Design view based on the Employees table. The second expression, called Comments, will result in field lengths greater than 255 characters:
Query: MemoExpr
------------------------------------------------
Type: Select Query
Field: Full Name: [FirstName] & " " & [LastName]
Table: Employees
Field: Comments: [HireDate] & ": " & [Notes]
Table: Employees
- On the Query menu, click Append Query.
- In the Append dialog box, type EmpNotes in the Table Name box, and then click OK.
- Select EmpName in the Append To row of the Full Name field in the QBE grid; the Append To row for the Comments field fills in automatically because the field name in the query and the field name in the table are the same.
- On the Query menu, click Run. Click Yes when prompted that you are about to append the rows.
- Close the MemoExpr query. You do not need to save it.
- Export the EmpNotes table to whatever format you want. The full length of the Comments field will be preserved.
REFERENCESFor more information about exporting data to text files, click Microsoft Access Help on the Help menu, type export a datasheet to a delimited or fixed-width text file in the Office Assistant or the Answer Wizard, and then click Search to view the topic.
Modification Type: | Major | Last Reviewed: | 6/24/2004 |
---|
Keywords: | kbfix kbprb KB207668 |
---|
|