<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sat, May 16, 2015 at 2:19 PM, silvioprog <span dir="ltr"><<a href="mailto:silvioprog@gmail.com" target="_blank">silvioprog@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="">On Sat, May 16, 2015 at 1:51 PM, Michael Van Canneyt <span dir="ltr"><<a href="mailto:michael@freepascal.org" target="_blank">michael@freepascal.org</a>></span> wrote:</span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><div><span class="">
On Sat, 16 May 2015, silvioprog wrote:<br>
</span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span style="color:rgb(34,34,34)">[...] </span><br></blockquote></div></div></blockquote><span class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"></blockquote></div></div>
Set the stoUseImplicit option on the transaction:<br>
<br>
VCon.Transaction.options:=[stoUseImplicit]</blockquote><div><br></div></span><div>Thanks for the fast reply buddy.</div><div><br></div><div>I have another problem: my FPC version is 2.6.4, and this option is not available in this version. =/</div><div><br></div><div>But just to test, I did it using FPC from trunk, and the following code returned another error:</div><div><br></div><div>[code]</div><div><span class=""><div>var</div><div>  VCon: TPQConnection;</div><div>begin</div><div>  VCon := TPQConnection.Create(nil);</div><div>  VCon.Transaction := TSQLTransaction.Create(VCon);</div><div>  try</div></span><div>    VCon.Transaction.Options := VCon.Transaction.Options + [stoUseImplicit];</div><span class=""><div>    VCon.HostName := '127.0.0.1';</div><div>    VCon.DatabaseName := 'postgres';</div><div>    VCon.UserName := 'postgres';</div><div>    VCon.Password := 'postgres';</div><div>    VCon.ExecuteDirect(</div><div>      'CREATE DATABASE "09_0025" WITH ENCODING=''UTF8'' ' +</div></span><div>      '  OWNER="postgres" TEMPLATE="template1" ' +</div><div>      '  LC_COLLATE=''English_United States.1252'' ' +</div><span class=""><div>      '  LC_CTYPE=''English_United States.1252'' '+</div><div>      '  CONNECTION LIMIT=-1 TABLESPACE="pg_default"');</div><div>  finally</div><div>    VCon.Free;</div><div>  end;</div><div>end;</div></span></div><div>[/code]</div><div><br></div><div>Error:</div><div><br></div><div><div>#0 PQCONNECTION$_$TPQTRANS_$__$$_REGISTERCURSOR$TPQCURSOR at :0</div><div>#1 PQCONNECTION$_$TPQCONNECTION_$__$$_EXECUTE$TSQLCURSOR$TSQLTRANSACTION$TPARAMS at :0</div><div>#2 SQLDB$_$TSQLCONNECTION_$__$$_EXECUTEDIRECT$ANSISTRING$TSQLTRANSACTION at :0</div><div>#3 SQLDB$_$TSQLCONNECTION_$__$$_EXECUTEDIRECT$ANSISTRING at :0</div><div>#4 TFORM1__BUTTON1CLICK(0x1dc248, <error reading variable>) at Unit1.pas:45</div><div>...</div></div><span class=""><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Why methods like "ExecuteDirectPG", "CheckConnectionStatus", "CheckResultError", "TranslateFldType" and "GetExtendedFieldInfo" are not declared as protected methods?<br>
</blockquote>
<br></span>
No particular reason. That can be changed.<span><font color="#888888"><br>
<br>
Michael.</font></span></blockquote></span></div><div><br></div><div>Very nice. I can create a patch to move this methods to the protected area. =)</div></div></div></blockquote></div><div class="gmail_extra"><br></div>Done:</div><div class="gmail_extra"><br></div><div class="gmail_extra"><a href="http://bugs.freepascal.org/view.php?id=28125">http://bugs.freepascal.org/view.php?id=28125</a><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Silvio Clécio<br>My public projects - <a href="http://github.com/silvioprog" target="_blank">github.com/silvioprog</a></div>
</div></div>