From: Date: April 17 2006 4:57am Subject: Retrieving Binary Data List-Archive: http://lists.mysql.com/plusplus/5643 Message-Id: <44430405.9090402@billism.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hello, After trial and error over a few hours, it looks like retrieving binary data that contains 0 (null) characters is not possible with mysql++. Is this correct? I am using mysql++ 2.1.1 and MySQL Server 5.0 What I am doing with mysql++ is executing this: "SELECT pri_key, CAST(message AS BINARY) message FROM blockedmessages;" The message column is defined as a BLOB in MySQL. The row.at(1).size() and row.at(1).length() return the length of the data as if it were a string (terminated by the first occurring null character). There seems to be no way with mysql++ to easily access this binary data in full. When I hard code a malloc const char* to the right length of the data, I can see that all the binary is actually put into memory, but there is no reference provided to access it. You just have to know how long the data really is and use a malloc or something. Am I right, or am I missing something? Thanks! - Bill Krahmer