My database open (runs once only in mainstack on open card) looks like this:
<div><br></div><div>note: I don't have any special stuff there for windows so I wonder if that is bad?</div><div><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'; min-height: 16.0px"><br>
</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Lucida Grande'"><b>on</b> DatabaseOpen</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Lucida Grande'"> <span style="color: #8e920e"><b>put</b></span> <span style="color: #1e0090">""</span> <span style="color: #910a91">into</span> <span style="color: #910a91">field</span> error_field <span style="color: #910a91">of</span> <span style="color: #910a91">card</span> <span style="color: #1e0090">"Client Card"</span> <span style="color: #910a91">of</span> <span style="color: #910a91">stack</span> <span style="color: #1e0090">"clients"</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Lucida Grande'"> <span style="color: #8e920e"><b>put</b></span> <span style="color: #1e0090">""</span> <span style="color: #910a91">into</span> <span style="color: #910a91">field</span> IsOpenField <span style="color: #910a91">of</span> <span style="color: #910a91">card</span> <span style="color: #1e0090">"Client Card"</span> <span style="color: #910a91">of</span> <span style="color: #910a91">stack</span> <span style="color: #1e0090">"clients"</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Lucida Grande'; color: #1e0090"><span style="color: #000000"> </span><span style="color: #8e920e"><b>put</b></span><span style="color: #000000"> </span>""<span style="color: #000000"> </span><span style="color: #910a91">into</span><span style="color: #000000"> </span><span style="color: #910a91">field</span><span style="color: #000000"> </span>"record ID"<span style="color: #000000"> </span><span style="color: #910a91">of</span><span style="color: #000000"> </span><span style="color: #910a91">card</span><span style="color: #000000"> </span>"Client Card"<span style="color: #000000"> </span><span style="color: #910a91">of</span><span style="color: #000000"> </span><span style="color: #910a91">stack</span><span style="color: #000000"> </span>"clients"</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Lucida Grande'; color: #1e0090"><span style="color: #000000"> </span><span style="color: #8e920e"><b>put</b></span><span style="color: #000000"> </span>""<span style="color: #000000"> </span><span style="color: #910a91">into</span><span style="color: #000000"> </span><span style="color: #910a91">field</span><span style="color: #000000"> </span>"total records"<span style="color: #000000"> </span><span style="color: #910a91">of</span><span style="color: #000000"> </span><span style="color: #910a91">card</span><span style="color: #000000"> </span>"Client Card"<span style="color: #000000"> </span><span style="color: #910a91">of</span><span style="color: #000000"> </span><span style="color: #910a91">stack</span><span style="color: #000000"> </span>"clients"</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Lucida Grande'; min-height: 15.0px"> </p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Lucida Grande'; color: #1e0090"><span style="color: #000000"> </span><span style="color: #8e920e"><b>get</b></span><span style="color: #000000"> Valentina_InitClient( </span>10<span style="color: #000000"> * </span>1024<span style="color: #000000"> * </span>1024<span style="color: #000000">,</span>"hulking long serial number"<span style="color: #000000">,,)</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Lucida Grande'"> <span style="color: #8e920e"><b>get</b></span> Valentina_DebugLevel(<span style="color: #1e0090">"kLogParams"</span>)</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Lucida Grande'"> <span style="color: #8e920e"><b>put</b></span> VConnection_Constructor(<span style="color: #1e0090">"localhost"</span>, <span style="color: #1e0090">"sa"</span>, <span style="color: #1e0090">"sa"</span>, <span style="color: #1e0090">15432</span>) <span style="color: #910a91">into</span> gConnection</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Lucida Grande'; min-height: 15.0px"> </p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Lucida Grande'"> <b>if</b> VConnection_Open( gConnection ) <span style="color: #910a91">contains</span> <span style="color: #1e0090">"ERROR"</span> <b>then</b> </p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Lucida Grande'"> <span style="color: #8e920e"><b>answer</b></span> <span style="color: #910a91">error</span> Valentina_ErrString()</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Lucida Grande'; color: #019103"><span style="color: #000000"> <b>return empty</b></span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Lucida Grande'"> <b>else</b></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Lucida Grande'; color: #019103"><span style="color: #000000"> </span><b>--nothing here</b></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Lucida Grande'"> <b>end</b> <b>if</b> </p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Lucida Grande'"> <span style="color: #8e920e"><b>put</b></span> VDatabase_Constructor( gConnection ) <span style="color: #910a91">into</span> gDatabase</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Lucida Grande'"> <span style="color: #8e920e"><b>get</b></span> VDatabase_DateFormat(gDatabase, <span style="color: #1e0090">"kYMD"</span>)</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Lucida Grande'"> <span style="color: #8e920e"><b>get</b></span> VDatabase_DateSep(gDatabase, <span style="color: #1e0090">"-"</span>)</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Lucida Grande'"> <span style="color: #8e920e"><b>get</b></span> VDatabase_Open( gDatabase, b_l_database.vdb )</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Lucida Grande'; min-height: 15.0px"> </p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Lucida Grande'"> <b>if</b> it <span style="color: #910a91">contains</span> <span style="color: #1e0090">"ERROR"</span> <b>then</b> </p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Lucida Grande'; color: #1e0090"><span style="color: #000000"> </span><span style="color: #8e920e"><b>answer</b></span><span style="color: #000000"> </span>"there was an error in DatabaseOpen"</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Lucida Grande'"> <b>end</b> <b>if</b></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Lucida Grande'"><b>end</b> DatabaseOpen</p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Lucida Grande'"><br></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Lucida Grande'">
Then I call (just to be sure that it really opened):</p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Lucida Grande'"><br></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Lucida Grande'">
</p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Lucida Grande'"><b>on</b> ShowStatistics</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Lucida Grande'"> <span style="color: #8e920e"><b>put</b></span> VDatabase_Name( gDatabase ) <span style="color: #910a91">into</span> <span style="color: #910a91">field</span> <span style="color: #1e0090">"error_field"</span> <span style="color: #910a91">of</span> <span style="color: #910a91">card</span> <span style="color: #1e0090">"Client Card"</span> <span style="color: #910a91">of</span> <span style="color: #910a91">stack</span> <span style="color: #1e0090">"clients"</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Lucida Grande'"> <span style="color: #8e920e"><b>put</b></span> VDatabase_IsOpen( gDatabase ) <span style="color: #910a91">into</span> <span style="color: #910a91">field</span> <span style="color: #1e0090">"IsOpenField"</span> <span style="color: #910a91">of</span> <span style="color: #910a91">card</span> <span style="color: #1e0090">"Client Card"</span> <span style="color: #910a91">of</span> <span style="color: #910a91">stack</span> <span style="color: #1e0090">"clients"</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Lucida Grande'"><b>end</b> ShowStatistics</p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Lucida Grande'"><br></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Lucida Grande'">
then I call (if the show statistics was ok) a bunch of stuff that pulls data from the database and fills out cards, option buttons etc.</p><p></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Lucida Grande'">
<br></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Lucida Grande'"><br></p></div>