Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Merging in Word with an Access binary field data source

Status
Not open for further replies.

Guggly

Programmer
Jan 18, 2004
110
US
For some reason MS Word doesn't seem to support merging data from Access if the Access field type is binary. Anyone know of a workaround?

Access doesn't give binary as a field type when you create a table, but if you run a Make-Table query with one of the values containing Null, the data type for that field is created as binary.

Run this SQL string in Access to see what I mean.
Code:
SELECT 1 AS ID, Null AS BinaryValue, "Sample" AS [Text] INTO tblTest;

Now put a value in the BinaryValue field (and fill a couple other rows if you like) and then try to attach it to a Word MailMerge document. The merge engine recognizes the field, but won't use any of the data.

Any thoughts? Thanks! -- Mike
 
do u not need to convert the binary 2 text? i know for getting graphics stored as byte arrays in Access fields, data is pulled out, set a temp file (txt - even though it is graphics file data as byte array); then opened/inserted into Word as a renamed file. also i think, you may nedto use StringFromGUID mehtod. the following from MSDN:

The Microsoft Jet database engine stores GUIDs as arrays of type Byte. However, Microsoft Access can't return Byte data from a control on a form or report. In order to return the value of a GUID from a control, you must convert it to a string. To convert a GUID to a string, use the StringFromGUID function. To convert a string back to a GUID, use the GUIDFromString function.

For example, you may need to refer to a field that contains a GUID when using database replication. To return the value of a control on a form bound to a field that contains a GUID, use the StringFromGUID function to convert the GUID to a string.

Note that in order to bind a control to the s_GUID field of a replicated table, you must click Options on the Tools menu and select the System Objects check box on the View tab of the Options dialog box.

 
Thanks for your reply Phaed. Perhaps I do need to convert to text. I was hoping to not have to do that since I store only numbers in this field, though they get added in afterwards. I cannot use 0 to initialize the field, but I will see if I can use another value.

-- Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top