On Thu, September 7, 2006 20:23, DEV wrote:
> Does anyone out here have an example of using PGSTD::string > pqxx::transaction_base::esc ( const PGSTD::string & ) to store and > pull > an image out of a table field and display it in a vc++.NET application? Don't do that! The esc() functions are for text fields, not for binary data. "Text" does not mean an arbitrary series of bytes. Zero bytes inside your string, for instance, are not allowed in text and so esc() does not support them. Use fields of the binary "bytea" type instead. Escape your data with esc_raw(), and un-escape with the binarystring class. Or, if you expect some of your images to be very large, you can use the large-object API which works much more like regular files. I can't help you with how to display images in a Visual C++.NET application, but for the parts that have something to do with libpqxx, take a look at test062.cxx. If you want to insert your images using prepared statements, test092.cxx has the examples you need. Jeroen _______________________________________________ Libpqxx-general mailing list [email protected] http://gborg.postgresql.org/mailman/listinfo/libpqxx-general
