<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.dabo.leafe.com/index.php?action=history&amp;feed=atom&amp;title=HowToVisuallyFloatAControl</id>
	<title>HowToVisuallyFloatAControl - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.dabo.leafe.com/index.php?action=history&amp;feed=atom&amp;title=HowToVisuallyFloatAControl"/>
	<link rel="alternate" type="text/html" href="https://wiki.dabo.leafe.com/index.php?title=HowToVisuallyFloatAControl&amp;action=history"/>
	<updated>2026-11-21T09:08:17Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.12</generator>
	<entry>
		<id>https://wiki.dabo.leafe.com/index.php?title=HowToVisuallyFloatAControl&amp;diff=4181&amp;oldid=prev</id>
		<title>Ed: Created page with &quot;&lt;syntaxhighlight lang=&quot;python&quot;&gt; from dabo import dApp from MySQLdb import escape_string  # Set up dabo app = dApp() app.setup(False)  # Set up connection connection = app.getC...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.dabo.leafe.com/index.php?title=HowToVisuallyFloatAControl&amp;diff=4181&amp;oldid=prev"/>
		<updated>2020-05-17T14:26:04Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt; from dabo import dApp from MySQLdb import escape_string  # Set up dabo app = dApp() app.setup(False)  # Set up connection connection = app.getC...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from dabo import dApp&lt;br /&gt;
from MySQLdb import escape_string&lt;br /&gt;
&lt;br /&gt;
# Set up dabo&lt;br /&gt;
app = dApp()&lt;br /&gt;
app.setup(False)&lt;br /&gt;
&lt;br /&gt;
# Set up connection&lt;br /&gt;
connection = app.getConnectionByName(&amp;quot;Your connection name&amp;quot;)&lt;br /&gt;
crs = connection.getDaboCursor()&lt;br /&gt;
&lt;br /&gt;
binarydata = &amp;quot;This could be anything, including pictures, executables etc.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Make sure the blob type is large enough to hold your binary data&lt;br /&gt;
crs.execute(&amp;quot;&amp;quot;&amp;quot;CREATE TEMPORARY TABLE blobtable (b BLOB)&amp;quot;&amp;quot;&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# We need to escape our binary value so MySQLdb doesn&amp;#039;t try to add it as a string&lt;br /&gt;
#crs.execute(&amp;quot;&amp;quot;&amp;quot;INSERT INTO blobtable SET b=&amp;quot;%s&amp;quot; &amp;quot;&amp;quot;&amp;quot; % escape_string(binarydata))&lt;br /&gt;
&lt;br /&gt;
# PKM: actually, I&amp;#039;ve found that this step isn&amp;#039;t necessary. Just &lt;br /&gt;
# remove the quotes, e.g.:&lt;br /&gt;
crs.execute(&amp;quot;INSERT INTO blobtable SET b=%s&amp;quot; % binarydata)&lt;br /&gt;
&lt;br /&gt;
# A normal error here is &amp;quot;MySQL server has gone away&amp;quot;. This could mean that&lt;br /&gt;
# the server has lost connection, or that the query is larger than MySQL is&lt;br /&gt;
# configured to accept. To change this value edit My.ini (in the MySQL server directory),&lt;br /&gt;
# and add the line &amp;quot;max_allowed_packet=xM&amp;quot; where x is the allowed size of the query.&lt;br /&gt;
# This should be at least the size of the file you are trying to add.&lt;br /&gt;
&lt;br /&gt;
# Print our data and verify that it is right&lt;br /&gt;
crs.execute(&amp;quot;&amp;quot;&amp;quot;SELECT b FROM blobtable&amp;quot;&amp;quot;&amp;quot;)&lt;br /&gt;
bindata = crs.getDataSet()[0][&amp;quot;b&amp;quot;]&lt;br /&gt;
print &amp;quot;Retrieved data:&amp;quot;, bindata&lt;br /&gt;
print &amp;quot;It has the same value?&amp;quot;, binarydata == bindata&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ed</name></author>
	</entry>
</feed>